ios / \ / \ / \ / \ istream ostream / \ / \ / \ / \ / \ / \ / \ / \ ifstream iostream ofstream
cin >> a >> b >> c;is the same as
cin >> a; cin >> b; cin >> c;
The ISO standard also defines manipulators in iostream, fixed, scientific, left and right among others, which can be used to set formats without calling setiosflags BUT some compilers have not implemented them yet. The version of the g++ compiler that we use implements them. eg.
ifstream iStr("myfile");If the stream was not successfully attached, either by the open method or in a declaration, the stream can be tested and will be false. eg
if (iStr) // file was successfully attached; else // file was not successfully attached;
ofstream oStr("myfile");If the stream was not successfully attached, either by the open method or in a declaration, the stream can be tested and will be false. eg
if (oStr) // file was successfully attached; else // file was not successfully attached;