c++类里定义链表出现错误


#include 
#include >

using namespace std;
class Class
{public:
    static int stunum;
    static void printfstunum();
    typedef struct student
{
    char name[20];
    char num[20];
    struct node *next;
}Lnode,*linklist;
void initstu(Lnode *head)
{   head=(linklist)malloc(sizeof(Lnode));
    head->next=NULL;
}
void insertstu(Lnode *head)
{   Lnode p;
     p=head->next;
        while(p!=NULL)
        {
           p=p->next;
        }
            if(p==NULL)
            {
            cout<<"请输入学生信息"<>p->name,p->num>>endl;
            }
}
void showstu(Lnode *head)
{
    Lnode p=head->next;
    while(p!=NULL)
    {
        cout<name,p->num<next;
    }
}




};
int Class::stunum=20;
int main()
{  Class a;
   a.printfstunum();

    return 0;
}
void Class::printfstunum()
{

    cout<<"班级人数为:"<

img

img


如果输出需要用','隔开的话这样写


cout<<p->name<<','<<p->num<<endl;