Run time error on large array sizes in C/C++
This question already has an answer here:
In C++, when you're doing this:
unsigned long long a[100000];
It allocates the memory from the stack. Stack memory is limited so you can't do too big allocations.
When you do this:
unsigned long long* a = new unsigned long long[1000000];
It allocates the memory from the heap. Heap allocations can be big.
More information about stack and heap memory is in this Stack Overflow post.
链接地址: http://www.djcxy.com/p/79802.html上一篇: 如何在解构器中正确释放变量