首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

求解C++类中怎么声明const void* GetX(){renturn &x}

2013-04-26 
求解C++类中如何声明const void* GetX(){renturn &x}怎样用const void*#include stringclass CData{pri

求解C++类中如何声明const void* GetX(){renturn &x};
怎样用const void*
#include <string>
class CData
{
private:
unsigned long int index;
public:
const void* GetDataIndex();
};
#include "CData.h"
const void* CData::GetDataIndex(){return &index;}
报错
class CData
{
private:
unsigned long int index;
public:
const void* GetDataIndex(){return &index;};
};
不报错......................
[解决办法]
报什么错?跟const void*应该没关系
[解决办法]
不要说又是分号,应该不是这种低级错误吧,。
[解决办法]
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/const_void.exe : fatal error LNK1120: 1 unresolved externals

热点排行