The ____________ fstream member function opens a file stream and connects the stream variable to a physical file whose name is the argument to the function.
a) close( )
b) overloaded operator <<( )
c) open( )
d) eof( )
e) flush( )
c) open( )
Part c) opens a file stream and connects it to a physical file. The argument is a C-string constant or variable. Part a) close() is used without argument to close the file to prevent file corruption, a possibility if the program terminates abnormally. Part b) has nothing to do with opening a file. Part d) returns a type bool value of true if the file pointer has attempted to read at end of file. Part e) flush( ) is used without argument to write the file buffer out to the physical medium.
You might also like to view...
When invoking fork, the child process receives a return value of _________, and the parent process receives________as the return value.
a) –1, child’s pid. b) 0, child’s pid. c) parent’s pid, 0. d) None of the above.
Describe the syntax for the su command and explain the purpose of the username parameter.
What will be an ideal response?