devxlogo

January 3, 2001

Octal and Hexadecimal Output

By default, cout displays integral values as decimal numbers. You can override this setting and have integral values displayed in hexadecimal and octal notations by using the ‘hex’ and ‘oct’

Casting To and From void*

In C++, pointers are strongly-typed. Therefore, you can’t assign a void pointer to any other pointer type without casting it explicitly: int n;void *p = &n;int *pi=static_cast< int* >(p);//C++ requires

Null Pointers and Delete

C++ guarantees that operator delete checks its argument for null-ness. If the argument is 0, the delete expression has no effect. In other words, deleting a null pointer is a

Switching Between Fixed and Scientific Notation

By default, iostream objects are set to display floating point values in fixed notation. To change this, you apply the ‘scientific’ manipulator to an output stream object: #include using namespace