visual C++中error C2352是什么意思

如题所述

这个错误是:非静态成员函数的非法调用

是不是你在调用类函数的时候,直接使用 类名::非静态函数名(参数) 这种方式,调用了类里面的非静态成员函数?

静态函数是类的成员。非静态函数是对象的成员。静态函数只能操作静态成员和静态函数,按这个思路找找。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-07-30
error C2352 : 非静态成员函数的非法调用
第2个回答  2012-07-27
'class::function' : illegal call of non-static member function
The specified nonstatic member function was called in a static member function.
The following is an example of this error:
class X

{
public:
static void func1();
void func2();
static void func3()
{
func1(); // OK, calls static func1
func2(); // error, calls nonstatic func2
}
};本回答被网友采纳