Results 1 to 3 of 3

Thread: Urgent question!!!

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2001
    Posts
    38

    Exclamation 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!

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2001
    Posts
    38
    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
  •  



Click Here to Expand Forum to Full Width