hmm I tried something loike this:
#include <iostream>
int main()
{
int *array = new int[600000000];
std::cout << "Test 1: sizeof(int) = " << sizeof(int) << std::endl;
array[0] = 5;
std::cout << "Test 2: array[0] = " << array[0] << std::endl;
system("pause");
delete[] array;
return 0;
}
#include <iostream>
int main()
{
int *array = new int[600000000];
std::cout << "Test 1: sizeof(int) = " << sizeof(int) << std::endl;
array[0] = 5;
std::cout << "Test 2: array[0] = " << array[0] << std::endl;
system("pause");
delete[] array;
return 0;
}
To copy to clipboard, switch view to plain text mode
and it is working fine on Vista Business 64. sizeof(int) is 4 so 4*600000000 is about 2.4GB - didn't try more, because I have 2GB of RAM in my notebook.
But my program was compiled with Visual Studio compiler with target machine x64 (so it is 64-bit executable - not working on 32-bit windows).
And make it clear:
Is the latest Qt compiler 64-bit?
Qt it is a bunch of C++ classes so there is no Qt C++ compiler (just some tools making use of Qt easier) so if there are some limitations of a compiler - it is only depend on your compiler. If you have downloaded Qt SDK then I suppose that you have MinGW - I don't know this one, but I think it is not generating 64-bit code (by default).
P.S. I tried also you code from first post and it is working good even for 2000000000.
Bookmarks