Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insufficient memory 1

Status
Not open for further replies.

kalaiarasi

Programmer
Feb 6, 2002
7
MY
Hi all,

I tried to declare a large array size:

int array [50][320*240];

but i am getting runtime error: The exception unknown
software exception (0xc00000fd) occured in the application at location ...

is there any way i can solve this?

Pls help!

Kalai
 
Are You sure if the exception was really caused by the array? If yes, do You have enough free memory? The array needs over 15 MB in RAM. You can try to use, for example, 50 arrays [320*240] instead - it is easyer for the system to alloc memory for them.
 
Yes, the exception is caused by the array. Are u saying i must declare 50 array variables with that size?
 
So, for example:
int array1[320*240];
int array2[320*240];
int array3[320*240];
int array4[320*240];
...
int * array[50] = {array1, array2, ...};

and then You can use it so:
*(array + j) = 13; //it will be Your old array[j] = 13;
It is easyer for the system to alloc 50 short pieces as one big. If it does not work, You must reduce the memory size (for example, use short instead int).
 
or you can do :
Code:
int* array[50];

for(int i = 0;i<50;i++)
{
    array[i] = new int[320*240];
}

but dont forget to delete em!!!!

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top