summary10 - o ofstream – output file stream • connect...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
These functions are called member functions . A class is a type whose variables are objects. The object’s class (that is, the type of the object) determines Summary Ch 5.1 Chapter 5.1 Streams and Basic File I/O Stream- a flow of characters (or other kind of data) Input stream- flow into program (from keyboard or file) Output stream- flows out of program (can go to screen or file) cin and cout are streams used in the <iostream> library Can also store data in files permanently o ifstream – input-file stream
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: o ofstream – output file stream • connect stream variables to file by "infile.dat" ); And close them by in_stream.close(); • add ios::app as a second argument to append to a file without erasing the contents • can use two names external file name (infile.dat), and stream name (in_stream) • exit( int) – immediately ends the program (1 – error, 0 – other) <cstdlib> • verify whether an input/output file is opened by
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online