Thread: Problem with stringstream

  1. #16
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    A buffer overrun
    somethere in the route you are witing a buffer that is bigger than the allocated space...
    or wirting to the not-existing index of array... or something like that

    it also explains randomness of the error - it occures when you trying to read the garbage, not when you put it there...
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  2. #17
    Registered User
    Join Date
    Oct 2006
    Location
    UK/Norway
    Posts
    485
    But the buffer overrun should then be in the intToString() function? As it is only when I add that I get the error.

  3. #18
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by h3ro View Post
    But the buffer overrun should then be in the intToString() function? As it is only when I add that I get the error.
    No. It could be anywhere else... In the function where the crash occures - you just go to read the corrupted memory...

    And adding or removing part of the code just moves the corrupted block up and down along the heap or stack - causing the crash to occure in different parts of the code
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  4. #19
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    What compiler are you using? What is your warning level set to? Do you have a built-in debugger?
    Mainframe assembler programmer by trade. C coder when I can.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. stringstream to float problem
    By c0d3m0nk3y in forum C++ Programming
    Replies: 10
    Last Post: 02-01-2008, 04:07 AM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM