结构体的初始化???
程序代码:
#include <stdio.h> #include<stdlib.h> struct student { int id; char name[20]; student * next; }; void list(student * list) { student * p = list; //p=list-next; while(p) { printf("%d,%s\n",p->id,p->name); p=p->next; } } int main() { student str ; str = { {1,"aaa"}; {2,"bbb"}; {3,"ccc"}; {4,"ddd"}; } return 0; }
结构体应该怎么初始化 比如一次性有很多数据? 默认输入的