|
-
Oct 23rd, 2001, 11:46 AM
#1
Thread Starter
Member
Urgent question!!!
Hello everyone!
This is for a project that I am currently working on:
Compiler: GCC
OS: Sun Solaris 5.6 (Unix)
What is the maximum size of an array?
Code:
const maxArray = 10 meg ?? 50 meg??
int b[maxArray]
I am also using: malloc => i am sure that amount is reserved.
One side effect though, the program crashes more frequently than before.
Thnx!
-
Oct 24th, 2001, 07:56 AM
#2
the theoratical maximum depends on stack size. I don't know for Unix, but for windows the default is 1 MB (you can override this). But if you use up the whole MB, nothing else can be done - function calls, other stack variables etc. will cause your program to crash.
malloc can reserve more space.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 24th, 2001, 11:01 AM
#3
Thread Starter
Member
thnx...
But i figured it out when i was at work..
the program runs "smoothly" now (with some minor adjustments)
thnx anyway
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
|