Assertion Problem

This is a discussion on Assertion Problem within the C Programming forums, part of the General Programming Boards category; I've also run into this, and is terribly annoying during development. Anytime a character is ran through a certain set ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    2

    problem

    I've also run into this, and is terribly annoying during development. Anytime a character is ran through a certain set of functions (IsSpace, and IsNumber) are a few that I can tell, this assertial will happen.

    It only happens when compiled in debug, and only if the character has an ascii value of 128 (or 256, can't remember) or above.

    I'm not sure of a solution, but I'm pretty sure that should help clarify your problem.

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    I don't think the OP has been waiting over a year for help.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,310
    I agree. greggorob64, ask your own question.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    Yeah, you're not supposed to post in threads that haven't had any activity for two weeks or so.
    It only happens when compiled in debug, and only if the character has an ascii value of 128 (or 256, can't remember) or above.
    Well, that's easy to see. Assertions are disabled in release versions, so they would only happen in debug mode. And the assertion is this:
    Code:
    (unsigned)(c + 1) <= 256
    so anything that makes that false would cause an assertion. In this case, 256 or above or -2 or below would cause the problem.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    It should be noted that this thread was split from here: Assertion Failure

    Feel free to move my last post in there to this thread as well, laserlight.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  6. #6
    Registered User
    Join Date
    Dec 2007
    Posts
    2
    ha, i was just trying to help out. i didn't check out the date, it was jsut a reply (I wasn't asking any questions)

Popular pages Recent additions subscribe to a feed

Similar Threads

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

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