If I compiled this:
long double *N;
N = new long double[999999999];
I get this error:
error C2148: total size of array must not exceed 0x7fffffff bytes
So, I tried compiling this:
long double *N;
long double *N2;
N = new long double[999999999];
N2 = N + 99999999;
N2 = new long double[900000000];
I still didn’t run the program, but I’m pretty sure that I’ll get a heap corruption detected error because I don’t want to navigate with N then at a certain point navigate with N2.
Is there a safe why to do this with only one pointer ?
999999999*sizeof(double) is 7999999992 bytes. On a 32-bit platform, that is way more than 2^32 bytes. You simply can’t address that many bytes in a 32-bit application.
If you absolutely must have 1 billion doubles, use a 64-bit platform.