1 2 3 4 5 6 7 8 9 10 11 12

Some C++ features

In C++, 0 means false and 1 means true.
(In C, 0 means false and non-zero means true.)

A predicate is a function that returns 0 or 1 (a bool function)

The ! operator means not;The ! operator converts 0 into 1 and any integer other than 0 into a 0.

If you want to force the conversion of a value from one type into the corresponding value of another type, then you must cast the value in the following way:

(type) expression;
(double) 14;

If you want to compare two numbers of different types, then you must cast one to match the type of the other.

If you want to tell C++ that you intend to work with an input or output stream, then include the following in your header.

24-Mar-98

Page 4

TAM/C201