Redirection in C++


  • Redirection is a technique that allows the user considerable flexibility in the way the programs are used.
  • Output from a program is normally to the standard output file and this output can be redirected to a secondary storage file or to the printer.
  • Similarly, input redirection can be used to read data from a secondary storage file instead of the standard input file, the keyboard.
  • The following example implements the DOS TYPE command with the output being redirected to the printer.
  • To implement this using C++, open an object of ostream for printer which is shown below.
    Example

Manipulators<< Previous

Our aim is to provide information to the knowledge


comments powered by Disqus


Footer1