链 小实验

#include<iostream>
using namespace std;
struct stu
{char name[12];
 struct stu *next;
};
int main()
{struct stu *head,*p;
 head=new stu;
 cin>>head->name;
 p=head->next=new stu;
 cin>>p->name;
 p->next=NULL;
 cout<<head->name<<endl;
 cout<<p->name<<endl;
 return 0;
}
posted @ 2013-03-09 00:16  _一千零一夜  阅读(66)  评论(0编辑  收藏  举报