COSC 175 Lecture Notes - Lecture 13: Batch Processing
Document Summary
C++ can write and read from files just as to keyboard and screen: standard input file keyboard, standard output file screen. Advantages: can edit data, prepare ahead of time, can rerun file without reentering data, can examine output at leisure, can display output to screen or print, can use out as input into another programs. File named secondary memory area that holds a collection of information (data) Internal file: composed of characters only, differs from . doc(x) file, size of file, can be created in notepad, visual c. Open the file as an output file. Close the file (happens automatically when you exit the program) Ofstream: means that you are going to write to the file. Online time you need to name the file. The file doesn"t exist: it just creates it. The file does exist: it (cid:449)rites o(cid:448)er it, it"s gone. Infile points to file (can be any name) Infile >> cityname >> fahrtemp; (start and restart step)