error question

This is a discussion on error question within the C++ Programming forums, part of the General Programming Boards category; Hi, What does debug assertion failed mean? Thanks!...

  1. #1
    Registered User
    Join Date
    Dec 2006
    Location
    Jacksonville, AR
    Posts
    91

    error question

    Hi,

    What does debug assertion failed mean?

    Thanks!

  2. #2
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    I believe you're referring to an assert() function that failed it's test, but I'd need to see the exact error to be 100% sure.
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,417
    A function you called validated it's input parameters, and it failed.

    Look at the error message, or better still run the code in the debugger. Then when the debugger catches the assert, you start looking round to see what you did wrong.

    A good on is to fopen() a file, which returns NULL on error, then attempt to use that to read a file. The reading function could easily assert with fp != NULL (for example).
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

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