951. Which is correct syntax ?
A. myfile:open (“example.bin”, ios::out);
B. myfile.open (“example.bin”, ios::out);
C. myfile::open (“example.bin”, ios::out);
D. myfile.open (“example.bin”, ios:out);

952. ios::trunc is used for ?
A. If the file is opened for output operations and it already existed, no action is taken.
B. If the file is opened for output operations and it already existed, then a new copy is created.
C. If the file is opened for output operations and it already existed, its previous content is deleted and replaced by the new one.
D. None of the above

953. Which member function is used to determine whether the stream object is currently associated with a file?
A. is_open
B. Buf
C. String
D. None of the above

954. Which is correct syntax for, position n bytes back from end of fileObject ?
A. FileObject.seekg(ios::end, n);
B. FileObject.seekg(n, ios:end );
C. FileObject.seekg(n, ios::end );
D. FileObject.seekg(ios:end, n);

955. When fopen() is not able to open a file, it returns
A. EOF
B. Null
C. Runtime error
D. Compiler dependent

956. By default, all the files are opened in which of the following mode?
A. Binary Mode
B. Text Mode
C. Sequential Mode
D. Both A and B

957. How many objects are used for input and output to a string?
A. 1
B. 2
C. 3
D. 4

958. Calling the stream’s member function sync() causes an immediate synchronization.
A. Yes
B. NO
C. May Be
D. Can’t Say

959. Which of the following is not used to seek a file pointer?
A. ios::cur
B. ios::beg
C. ios::end
D. ios::set

960. fseek() should be preferred over rewind() mainly because
A. In rewind, there is no way to check if the operations completed successfully
B. rewind() doesn’t work for empty files
C. rewind() does work for empty file
D. All of the above

Leave a Reply