Documentation on if statements

The documentation in this site's tutorials on if statements does not discuss truthy or falsy values. I had to figure this out on my own when I saw it used on another site. In an if statement, the number 0 is falsy, and a nullptr is falsy. Non-null pointers are truthy, and non-zero numbers are truthy.

The tutorial here completely forgets to mention this:

http://www.cplusplus.com/doc/tutorial/control/

Can somebody please update the tutorial to say that?
http://www.cplusplus.com/doc/tutorial/typecasting/
The conversions from/to bool consider false equivalent to zero (for numeric types) and to null pointer (for pointer types); true is equivalent to all other values and is converted to the equivalent of 1.
I think it would help to mention it in the section on if statements too so people don't have to search for a long time to find that information.
Last edited on
Topic archived. No new replies allowed.