Stack ERROR

This is a discussion on Stack ERROR within the C++ Programming forums, part of the General Programming Boards category; I wont post the code as it is too large... Basicly, I compiled a large application I have been working ...

  1. #1
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475

    Stack ERROR

    I wont post the code as it is too large...

    Basicly, I compiled a large application I have been working on
    and it compiled and linked ok. But then after the program had executed I got an error box up saying:

    "An Exception has occured in your program"
    " Stack overflow."
    "Break " Continue "Ignore"

    I pressed break and then when I went to re-build my program I had to delete a file from the debug folder called

    "vc80 pdb" Which I did.. then it worked ok then I got the original error back again!

    What is going on!! Am I using up too much memory?

    I tried it in DevC++ and it worked perfecly fine. The error only occured when I used MSVC++ 2003.net. Is there somthing I can do to prevent this error?

  2. #2
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    964
    the stack has a set limit of stuff you can put in it..

    Put big stuff on the heap!

    At least i'm pretty sure this is the way it works
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

  3. #3
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    My application has about 7 files to it.. Should I reduce these to correct the error?

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    7,317
    It's not the number of files. It is the code. There is probably a bug in your code that is causing the program to use too much stack space. If it worked in Dev-C++, then there might be something fishy with your build, but normally a stack overflow means you called a recursive function too many times or ended up in an infinite loop that uses more and more memory.

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,420
    int big[10000];
    as a local variable, plus lots of recursion would usually blow the stack away.

    Check the sizes of some of the arrays you have, and whether there's any uncontrolled recursion.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  2. Crazy errors caused by class, never seen before..
    By Shamino in forum C++ Programming
    Replies: 2
    Last Post: 06-10-2007, 11:54 AM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 12:10 AM

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