2017uyun:编程问题

来源:百度文库 编辑:中科新闻网 时间:2024/05/05 01:50:52
#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
//……
}

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