error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int

来源:互联网 发布:时间碎片软件 编辑:程序博客网 时间:2024/05/22 08:02

VC6.0工程转VS2010工程出现的错误

 

问题:

 error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认

 

VC6.0代码:

operator=(const CVector2<type>& rv){this->x = rv.x;this->y = rv.y;};

 

解决方法:

 

VS2010代码

const CVector2& operator=(const CVector2<type>& rv){this->x = rv.x;this->y = rv.y;return *this;};//说明:CVector2为类



 

 

0 0
原创粉丝点击