






Boolean Conversion
Numeric values and pointers are implicitly converted to a Boolean value in conditional expressions. For example: void *p = get_ptr();if(p){ // process p} A zero value evaluates as false. All
Numeric values and pointers are implicitly converted to a Boolean value in conditional expressions. For example: void *p = get_ptr();if(p){ // process p} A zero value evaluates as false. All
In the early days of C, pointers were plain integers. Relics of this approach can still be found in vintage APIs and legacy code. For instance, the ANSI C header
The system() function (declared in ) launches another program from the current program. As opposed to what most users think, it doesn’t return the exit code of the launched process.
“getter” member functions usually return a result by value. However, when the returned value is a large object, a string for example, returning it by value can be very inefficient.
Exceptions report abnormal runtime situations. Although you have other mechanisms for detecting and reporting runtime errors, exceptions are advantageous because they automate the process of passing the error from a
The volatile specifier disables various optimizations that a compiler might automatically apply and thus introduce bugs. I