#include <iostream>
#include <malloc.h>>
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<<"请输入学生信息"<<endl;
cin>>p->name,p->num>>endl;
}
}
void showstu(Lnode *head)
{
Lnode p=head->next;
while(p!=NULL)
{
cout<<p->name,p->num<<endl;
p=p->next;
}
}
};
int Class::stunum=20;
int main()
{ Class a;
a.printfstunum();
return 0;
}
void Class::printfstunum()
{
cout<<"班级人数为:"<<stunum<<endl;
}
c++类里定义链表出现错误
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答
点击登录
提问题
悬赏问题
- ¥15 如何在linux服务器做视频静态资源访问接口
- ¥15 Python Xpath对<em>标签的爬取结果变成了- -(关键词-Xpath)
- ¥15 el-cascader懒加载模式选中单选框加载下层无数据问题
- ¥15 promql 参数怎么忽视大小写查询
- ¥50 swift使用textkit读取大文本文件速度慢的问题
- ¥20 统信linux360企业浏览器 如何配置扩展程序?(图形界面我知道)
- ¥100 c/c++实现DoubleArrayTrie
- ¥30 关于#网络安全#的问题:非对称加密验证
- ¥20 关于线性代数里施密特正交化和QR分解的疑问
- ¥15 matlab超类包含解析错误