Write a C++ code fragment that associates the input stream variable in with the input file data.txt and displays an error message if it is unable to open data.txt for input.
What will be an ideal response?
```
ifstream in( "data.txt", ios::in );
if (in.fail())
cerr << "Unable to open data.txt for input." << endl;
```
You might also like to view...
You have a program with a class that is separated into files. The implementation has been changed. Of the interface file, the implementation file and the application file, which must be recompiled?
a) Only the interface? b) Only the implementation? c) Only the Application? d) None of the above? e) Some of the above?
A(n) ____ style is a style rule inserted into the opening tag of an element using the style attribute.
A. online B. outline C. inline D. code line
________ are malicious programs that come into a computer system disguised as something else such as a free computer game or screen saver.
A. Rogues B. Zombies C. Trojan horses D. Scams
The procedures associated with an object are called ____.
A. methods B. processes C. attributes D. functions