Breaking News

Streams In C++

This section covers the basics of using streams, including explaining which streams are provided by the streams library, how the different streams classes are related, which member functions are available for use with streams, and …

Read More »

Stream Functions In C++

In addition to providing the insertion and extraction operations, the stream classes define a number of other member functions that can be more convenient than using insertion and extra ction directly.   All these functions …

Read More »

Formatting In C++

When a program inserts or extracts values other than single characters, such as integers or floating-point data, a number of different formatting options are available.   For instance, some applications might want to have an …

Read More »

Manipulators Again In C++

Use of the setf(), width(), and similar member functions is very convenient if the same specifications are used for a large number of inserted items.   If the formatting frequently changes, it is more convenient …

Read More »

I/O Status Handling In C++

Associated with each stream is a set of flags indicating the I/O state of the stream.   For example, the flag ios::eofbit indicates that no more characters can be extracted from a stream, and the …

Read More »

Function Templates In C++

We can also define function templates that could be used to create a family of functions with different arguments types. The general format template is:   template< class T> return-type functionname (arguments of type T) …

Read More »

Class Templates In C++

The concept of templates can be extended even to classes. Class templates are usually used for data storage (container) classes. Stacks and linked lists, which we encountered in previous chapters, are examples of container classes. …

Read More »

Exception Handling In C++

Check out whether your C++ compiler supports this feature (the older C++ compilers will not support exception handling).   This feature is used for dealing with certain specific situations (these situations are not supposed to …

Read More »