【发布时间】:2011-12-10 09:45:59
【问题描述】:
我使用 Visual Studio 2008。 我已经动态声明了变量 big_massive:
unsigned int *big_massive = new unsigned int[1073741824]
但是,当我尝试调试这个程序时,我得到了以下错误:Invalid allocation size: 4294967295 bytes. 我希望有什么方法可以避免这种错误?谢谢!
【问题讨论】:
-
32 位 Visual Studio 项目。但在 64 位项目中,我收到错误“test.exe 中 0x000007fefd74cacd 处的未处理异常:Microsoft C++ 异常:内存位置 0x002ef8b8 处的 std::bad_alloc ..”我的操作系统 - Windows 7 x64
-
32 位系统无法分配那么多内存,这会占用系统可用的所有内存。
标签: c++ dynamic allocation