|
-
April 25th, 2003, 02:01 PM
#1
allocating memory for a large 2-D array
hi,
i am writing a program in C which histograms data into a 2-D array. so i would like to work with a 4096x4096 array of type int which on my machine is 4-bytes (i'm running linux on a pentium II). after debugging, i've found that upon runtime, even the declaration:
int Array[4096][4096];
causes a "segmentation fault". the maximum value is:
int Array[1447][1447];
why the number 1447 i have no idea. i have searched this forum for help and found a suggestion using the function "malloc" but i'm not sure how to use this. could someone explain how i might override this limit and use a 4k x 4k array?
Thank you for any help you might be able to give.
-R.G.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|