PDF version - Computing Help - University of Cambridge
PDF version - Computing Help - University of Cambridge
PDF version - Computing Help - University of Cambridge
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
1A C++ courseworkhttp://www-h.eng.cam.ac.uk/help/tpl/languages/C++/...ifstream fin; // a variable used for storing info about a filefin.open("secretmessage"); // trying to open the file for reading// The next line checks if the file's been opened successfullyif(fin.good()) {// we've managed to open the file. Now we'll read a line// from the file into the stringgetline(fin, message);}else { // print an error messagecout