#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct student
{
int age;
char name[10];
struct student *next;
};
struct student *add(struct student *head,int age,char *name)
{
struct student *p = malloc(sizeof(struct student));
struct student *temp = NULL;
temp = head;
while(temp->next != NULL)
temp = temp->next;
strcpy(p->name,"name");
p->age = age;
p->next = NULL;
temp->next = head;
return head;
}
int main()
{
struct student *head = NULL;
struct student *q = NULL;
q = add(head,23,"wang");
while(q != NULL)
printf("%s %d",q->name,q->age);
}