Loading video...
Input/ Output (IO)
- The simplest form of input and output for a C++ program uses what is known as Character Streams – where characters “stream” into or out of the program from/to some external source.
- The objects we’ve used already, cin and cout, are external objects of classes inherited from “iostream” class.
- Two additional objects are cerr and clog
- “cin”, “cout”, “cerr” and “clog” are console streams. I/O is to the user terminal or console.
- The stream classes include useful methods, such as “get()”, “put()”, “good()”, “eof()”, and others.
- Streams can be formatted using I/O Manipulators
- Formatting includes width, precision, scientific notation, etc.
- Character streams can also connect from/to Files
- The file stream classes include additional methods for file manipulation, such as “open()”, “close()”, “read()” and “write()”.
- Here are links to more information about C++ input and output: http://www.cplusplus.com/doc/tutorial/basic_io/ http://www.cplusplus.com/doc/tutorial/files/
Input/ Output (IO)
Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.


































Start Learning Now
Our free lessons will get you started (Flash® 10 required).
Sign up for Educator.comGet immediate access to our entire library.
Features Overview