C
Clive Tooth
This works ok...
const int n = 500000000;
int[] a = new int[n];
a[1] = 2;
This fails with "Exception of type 'System.OutOfMemoryException' was
thrown."...
const int n = 600000000;
int[] a = new int[n];
a[1] = 2;
There seems to be a limit of 2GB on any array.
# If there is such a limit, where is it stated?
# How do I declare an array of more than 536,870,912 (=2^29) integers?
My computer has 16GB of RAM.
I am using Visual C# 2010 Express, Windows 7 Home Premium Version 6.1
(build 7601: Service Pack 1)
Microsoft Visual Studio 2010
Version 10.0.30319.1 RTMRel
Microsoft .NET Framework
Version 4.0.30319 RTMRel
const int n = 500000000;
int[] a = new int[n];
a[1] = 2;
This fails with "Exception of type 'System.OutOfMemoryException' was
thrown."...
const int n = 600000000;
int[] a = new int[n];
a[1] = 2;
There seems to be a limit of 2GB on any array.
# If there is such a limit, where is it stated?
# How do I declare an array of more than 536,870,912 (=2^29) integers?
My computer has 16GB of RAM.
I am using Visual C# 2010 Express, Windows 7 Home Premium Version 6.1
(build 7601: Service Pack 1)
Microsoft Visual Studio 2010
Version 10.0.30319.1 RTMRel
Microsoft .NET Framework
Version 4.0.30319 RTMRel