Stack overflow

This is a discussion on Stack overflow within the C Programming forums, part of the General Programming Boards category; When i problem-solve i get this sign"Stack ovelflow" how can getover this???...

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    28

    Stack overflow

    When i problem-solve i get this sign"Stack ovelflow" how can getover this???

  2. #2
    Registered User
    Join Date
    Feb 2003
    Posts
    595
    Many things can cause that sort of error. It's impossible to give you a useful answer without seeing the code that is causing it.

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I'm not in full agreement with R. Stiltskin, but yes, it's hard to give DIRECT advice further than what the error message itself says: You have tried to use stack-space beyond the maximum allowed size of the stack. This is USUALLY caused by either excessive recursion or many/large local variables (or a combination of these two).

    You get over it by choosing a solution that doesn't involve the excessive use of stack.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #4
    Registered User
    Join Date
    Feb 2003
    Posts
    595
    Quote Originally Posted by matsp View Post
    You get over it by choosing a solution that doesn't involve the excessive use of stack.
    --
    Mats
    "Doctor, it hurts when I do this ..."

  5. #5
    Maz
    Maz is offline
    Registered User Maz's Avatar
    Join Date
    Nov 2005
    Location
    Finland
    Posts
    194
    or in some cases by increasing the size of the threads stack. Some systems have relatively small default stacks.

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Maz View Post
    or in some cases by increasing the size of the threads stack. Some systems have relatively small default stacks.
    Of course. Since the Original post didn't mention stacks, I didn't think it was likely to be relevant, but sure.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Stack overflow errors in 3 areas
    By ulillillia in forum C Programming
    Replies: 13
    Last Post: 04-29-2007, 04:20 PM
  2. stack and pointer problem
    By ramaadhitia in forum C Programming
    Replies: 2
    Last Post: 09-12-2006, 12:41 AM
  3. Question about a stack using array of pointers
    By Ricochet in forum C++ Programming
    Replies: 6
    Last Post: 11-17-2003, 10:12 PM
  4. error trying to compile stack program
    By KristTlove in forum C++ Programming
    Replies: 2
    Last Post: 11-03-2003, 06:27 PM
  5. Stack Program Here
    By Troll_King in forum C Programming
    Replies: 7
    Last Post: 10-15-2001, 06:36 PM

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