此类链表创建最为简单,但是不利于下面的处理
void create(int n, type *stu) {
int i;
printf("输入数据\n");
for (i = 0; i < n; i++) {
stu = (type*)malloc(sizeof(type));
scanf("%d", &stu->data);
stu = stu->next;
}
return;
}
此类链表创建最为简单,但是不利于下面的处理
void create(int n, type *stu) {
int i;
printf("输入数据\n");
for (i = 0; i < n; i++) {
stu = (type*)malloc(sizeof(type));
scanf("%d", &stu->data);
stu = stu->next;
}
return;
}