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

请问定义一个const int指针报错的有关问题

2012-02-20 
请教定义一个const int指针报错的问题定义:constint*pnewconstint(1234)为什么在VC6里报errorC2468:new:

请教定义一个const int指针报错的问题
定义:const   int   *p   =   new     const   int(1234);
为什么在VC6里报
error   C2468:   'new '   :   cannot   allocate   'const '/ 'volatile '   objects   (type   is   'const   int ')
error   C2166:   l-value   specifies   const   object

[解决办法]
const int *p = new int(1234);

热点排行