Limited C ++ Distribution Size

I am using Visual Studio 2008. I dynamically declared the big_massive variable:

unsigned int *big_massive = new unsigned int[1073741824]

But when I tried to debug this program, I got the following error: Invalid allocation size: 4294967295 bytes. Hope there is some way to avoid such a mistake? Thank!

+3
source share
3 answers

32- x86 sizeof(int)==4 ( 4 ). 4 , (2 3 32- Windows boot.ini Windows, , 32- 64- Windows, 4 ).

64- 4 , .

+6

32- Windows 64- Windows 32- (WoW64): 2147483648 , 1073741824: 4294967296 , .

+3
  • 32- 4 . , 3 , , 10kB, - + 1GB . , .
  • , , . 32- int, , .
  • , RAM - . , . ( , , ). ( ) .
+1

Source: https://habr.com/ru/post/1539260/


All Articles