killed message

This is a discussion on killed message within the C Programming forums, part of the General Programming Boards category; I need a really large array to conduct a series of calculations. When I declare... int Uq[5764801][3]; ...my program compiles ...

  1. #1
    dougherk
    Guest

    killed message

    I need a really large array to conduct a
    series of calculations. When I declare...

    int Uq[5764801][3];

    ...my program compiles without warning or error (regardless of whether I actually include the calculation in the program or delete it).

    When I execute the program, I get an error message "killed" on the screen.

    Obviously the array is too big. How do I get C to handle extremely large arrays?

    THANKS,
    -Prof D

  2. #2
    eh ya hoser, got a beer? stumon's Avatar
    Join Date
    Feb 2003
    Posts
    323
    Are you sure you need such a big array? And are you sure thats the exact number you need? Why dont you creat some variable/struct and just allocate the memory when needed so you dont over use memory, you only use what you need. Show us your code and we may give you other alternatives.
    The keyboard is the standard device used to cause computer errors!

  3. #3
    Registered User
    Join Date
    Mar 2003
    Location
    UK
    Posts
    169
    int Uq[5764801][3]; = 69177612 bytes

    If you're declaring this array in a function (including main) then 69177612 bytes is going to be allocated from the stack. So it looks like you're out of stack, increase the stack size or make it a global.

    Or as stumon said, allocate the memory.
    Last edited by Scarlet7; 04-18-2003 at 06:06 PM.

  4. #4
    dougherk
    Guest

    killed message

    Thanks my friends. Following stumon's suggestions, I simply broke the program into 7ths and ran each large array separately.

    I'll save the other suggestions for the future. They're insightful.

    -Prof D

    p.s. Sorry about not responding sooner, I had problems getting on the c-programming page.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Strange string behavior
    By jcafaro10 in forum C Programming
    Replies: 2
    Last Post: 04-07-2009, 08:38 PM
  2. Global Variables
    By Taka in forum C Programming
    Replies: 34
    Last Post: 11-02-2007, 04:25 AM
  3. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 11:03 PM
  4. Dialog Box Problems
    By Morgul in forum Windows Programming
    Replies: 21
    Last Post: 05-31-2005, 06:48 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 10:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21