posted Dec 6, 2010, 8:44 AM by Thiyagaraaj M
updated Jul 18, 2011, 4:53 AM
- C++ language describes input/output using iostream.h.
- The standard input / output library for c described by the header stdio.h is still available in C++.
- The header stream.h was used on systems before release 2.0 and is still available under many C++ systems.
- Output is inserted into an object of type ostream.
- It is declared in the headerfile iostream.h.
- An operator << is loaded in this class to perform output conversions from standard types
- The overloaded left shift operator is called the “insertion or put to operator”.
- The standard output ostream corresponding to stdout is cout.
- The standard output ostream corresponding to stderr is cerr.
The member function flush() forces the stream to be written.
Formatted output & iomanip.h
The put to operator << produces by default the minimum number of characters.
Immediately prints the line:
User-defined types: output:
The input class isstream:
- An operator >> is overloaded in istream to perform input conversions to standard types
- The overloaded right shift operator is called the extraction or get from operator.
- The standard input istream corresponding to stdin is cin.
Useful member function:
- C have stdin,stdout,stderr.
- In addition, systems may define other standard files such as stdprn & stdaux.
- File I/O is handled by including fstream.h
- It contains the classes ofstream and ifstream
|Standard input file|
Standard ouput file
Standard error file
Standard printer file
Standard auxiliary file
If file exists open fails