#include<iostream>
#include<string>
using namespace std;
int stuNum=0;
//studentInfo * studentInfo::creStuInfo( void)
class studentInfo
{
public:
string name;
studentInfo * next;
};
void main()
{
studentInfo * p,* q,* head;
cout<<"请录入第"<<++stuNum<<"个学生的基本信息:"<<endl;
head=NULL;
head->next=p=q=(studentInfo * )malloc(sizeof(studentInfo));
cout<<"enter name:"<<endl;
cin>>p->name;
q=p;
p->next=p;
while(p!=NULL)
{
cout<<"请录入第"<<++stuNum<<"个学生的基本信息:"<<endl;
p=(studentInfo * )malloc(sizeof(studentInfo));
{
cout<<"enter name:"<<endl;
cin>>p->name;
}
q->next=NULL;
}
}