1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Assert fails but conditional passes?

Discussion in 'C++' started by daviddoria, Sep 6, 2010.

  1. daviddoria

    daviddoria New Member

    Joined:
    Sep 6, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Can anyone explain why this would fail:
    assert(cap >= 0);
    But this passes?
    if(cap < 0)
    {
    exit(-1);
    }
    That is, the assert is triggered, but if I replace it with conditional, the exit() function is never called.

    Thoughts?

    Thanks,

    David
     

Share This Page