O'Reilly logo

Sams Teach Yourself C++ in 24 Hours, Third Edition by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Nature of Truth

In previous versions of C++ all truth and falsity were represented by integers, but the new ISO/ANSI standard has introduced a new type: bool. This new type has two possible values, false or true.

Every expression can be evaluated for its truth or falsity. Expressions that evaluate mathematically to zero will return false, all others will return true.

Many compilers previously offered a bool type that was represented internally as a long int and thus had a size of 4 bytes. ANSI compliant compilers will now often provide a 1-byte bool.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required