![]() |
#2
mathspanda2012-06-13 08:59
|
#include <iostream.h>
class test
{
char get()
{
return a;
}
set(char c)
{
a=c;
}
private:
char a;
};
void main()
{
test my_test;
my_test.set('X');
}
编译出现错误:error C2248: 'set' : cannot access private member declared in class 'test'
求解!