
visual C++中error C2352是什么意思
展开全部
这个错误是:非静态成员函数的非法调用
是不是你在调用类函数的时候,直接使用 类名::非静态函数名(参数) 这种方式,调用了类里面的非静态成员函数?
静态函数是类的成员。非静态函数是对象的成员。静态函数只能操作静态成员和静态函数,按这个思路找找。
是不是你在调用类函数的时候,直接使用 类名::非静态函数名(参数) 这种方式,调用了类里面的非静态成员函数?
静态函数是类的成员。非静态函数是对象的成员。静态函数只能操作静态成员和静态函数,按这个思路找找。
展开全部
error C2352 : 非静态成员函数的非法调用
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
'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
}
};
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
}
};
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询