Note that there are some explanatory texts on larger screens.

plurals
  1. POC/C++ an int value that isn't a number?
    primarykey
    data
    text
    <p>Can this ever happen ? 3 asserts, where one should activate.</p> <pre><code>int nr = perform_calc(); assert( nr == 0); assert( nr &gt; 0); assert( nr &lt; 0); </code></pre> <p>Can there be a case when the program doesn't activate the asserts on g++ 3.4.4.</p> <p>And no I don't have the possibility to change the code in order to print the number out in case the asserts don't activate.</p> <p>Any ideas?</p> <p>Edit: After reading several comments I was forced to edit. Show the code? why are you doing this stupid thing ? I don't believe it ! Where is it used ? From my question it should have been obvious that I will not post/change the code because of several possible reasons:</p> <ul> <li>I'm a total beginner and is ashamed of the code (no crime there, sure it makes answering to the question much easier if I did post it)</li> <li>I was asked to help out a friend with only little information (and no I did not ask him why can't you check the number returned, or why can't he just add a breakpoint).</li> <li>I am writing my code in emacs without any compiler and is sending it to a remote server that compiles it, runs it and only can return failed asserts if something goes wrong.</li> </ul> <p>If you believed that I was making a prank or a hoax you should have voted for a closure of the thread instead. I would have been perfectly fine with that. But adding unnecessary comments like this only made me want an "attitude" flag to be implemented. </p> <p>I want to thank others for their comments and answers that actually tried to explain and answered my question.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload