Huge array error

So i was working on a program and made an array like this :
 
  int position[100000][2];

And, this doesn't seem to work :S
any ideas on how to make it run?

I also heard about something called 'huge'

like this : int huge position[100000][2];

this showed an error as well.
any suggestions?
In what kind of way doesnt it run?
I just tried a simple programm:
1
2
3
4
5
6
7
8
9
#include <iostream>

int main()
{
int position[100000][2];
position[1][1]=5;
std::cout << position[1][1];
return 0;
}

And as expectet the output is 5....
Could you please specify it.
it shows up an error saying : Array size too large
if you try to compile the short test code above also?
if not could i see the normal code?
i tried your code as well, didn't work
what compiler do you use?
and how much RAM does the pc have?

if you dont have enough RAM:
1
2
3
4
5
6
7
8
9
10
#include <iostream>
#include <stdio.h>
int main()
{
int position[100000][2];
position[1][1]=5;
std::cout << sizeof(position);
getchar();
return 0;
}

output:
800000

800000bytes=800mb
even if it doesnt use 800mb in that case i think it tries to reservate that amount of memory
Last edited on
Topic archived. No new replies allowed.