标签:rac com cte 变量 point person return bsp pre
//pointer to structure #include <stdio.h> struct Person { char name[10]; char character[20]; int age; }; void display(struct Person *t); int main() { struct Person man = {"jerry", "fastidious", 45}; display(&man); //取地址,与数组不一样,数组名就是地址,不需要取地址符号& return 0; } void display(struct Person *t) { printf("My name is %s, I‘m %d years old. And my friends always complain I‘m so %s.\n", t->name, t->age, t->character); //or: // printf("My name is %s, I‘m %d years old. And my friends always complain I‘m so %s.\n", (*t).name, (*t).age, (*t).character); }
标签:rac com cte 变量 point person return bsp pre
原文地址:https://www.cnblogs.com/profesor/p/13045770.html