Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/130.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 在线判断平台中的全局数组堆内存分配_C++_Arrays_Memory Management - Fatal编程技术网

C++ 在线判断平台中的全局数组堆内存分配

C++ 在线判断平台中的全局数组堆内存分配,c++,arrays,memory-management,C++,Arrays,Memory Management,下面是一个最简单的程序: #include <iostream> using namespace std; char c[1000 * 1000 * 100]; int main() { int a, b; while (cin >> a >> b) { cout << a+b << endl; } return 0; } #包括 使用名称空间std; 字符

下面是一个最简单的程序:

#include <iostream> 
using namespace std; 
char c[1000 * 1000 * 100]; 
int main() { 
     int a, b; 
     while (cin >> a >> b) { 
         cout << a+b << endl; 
     } 
     return 0; 
} 
#包括
使用名称空间std;
字符c[1000*1000*100];
int main(){
INTA,b;
而(cin>>a>>b){

cout
c
未在堆上分配。它存储在中。加载进程时保留数据段。

非常感谢您的回答。但我想知道是否立即分配它?