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

请教auto_ptr的reset该如何使用

2012-02-27 
请问auto_ptr的reset该怎么使用为什么我在使用auto_ptr的reset时编译不通过?#includestdafx.h #include

请问auto_ptr的reset该怎么使用
为什么我在使用auto_ptr的reset时编译不通过?
#include   "stdafx.h "
#include   <iostream>
#include   <   memory   >
using   namespace   std;
int   main(int   argc,   char*   argv[])
{
auto_ptr <   int   >   p_auto_int;         //默认构造
p_auto_int.reset(   new   int(   100   )   );
......
}
为什么会报错:error   C2039:   'reset '   :   is   not   a   member   of   'auto_ptr <int> '

[解决办法]
VC6把,还是早点扔了换VC7以上或者devcpp。
如果您真不肯换,那就认真查msdn里auto_ptr.

热点排行