Three ways to access structural members

xiaoxiao2021-03-06  115

Three ways to access structural members

#include "stdio.h"

#include "string.h"

#include

Main ()

{

Struct student {

Int Num;

Char * name;

int Score;

} STU;

Struct student * p = & stu;

stu.num = 1;

(* p) .Name = "Tom";

P-> score = 78;

Printf ("% D \ N", P-> Num);

Printf ("% s \ n", p-> name);

Printf ("% d \ n", p-> score);

}

转载请注明原文地址:https://www.9cbs.com/read-101503.html

New Post(0)