怪物猎人x虫子喂养:编程问题

来源:百度文库 编辑:高校问答 时间:2024/04/29 12:04:01
#include <iostream.h>
class student
{ public:
static char *sname()
{ cout << noofstudent<<endl;
return name; }
protected:
char name[40];
static int noofstudent;
};
int student::noofstudent=0;
void fn()
{ student s;
cout<<s.sname()<<endl; //error
//……
}

各位高手好:
小弟碰到一个静态函数成员访问的问题,请帮忙指出错误之处。谢谢。