Which of the following positions the file pointer for a file that has been opened for reading and writing?

a) Use the size() member function on the file stream to position the file pointer.
b) Use the seekp(arg) fstream member function with the number of records (counting the first record as 0) as argument to position the file pointer.
c) Use the seekp(arg) fstream member function with the number of bytes to the record in question (counting the first byte as 0) as argument to position the file pointer.
d) Use the sizeof operator to determine the number of bytes in the file stream.


c) Use the seekp(arg) fstream member function with the number of bytes to the record in question (counting the first byte as 0) as argument to position the file pointer.

Part a): there is no size() member of the fstream class. Part b) is almost right but uses record count rather than byte count. Part d) only supplies the size of the stream object, but does nothing to the stream object

Computer Science & Information Technology

You might also like to view...

Linux supports access to all versions of FAT using the ____ kernel module.

A. FAT B. LFAT C. VFAT D. NFS

Computer Science & Information Technology

?When you complete your work with Office Mix, __________. 

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The identification, analysis, and evaluation of risk in an organization describes which of the following?

A. risk assessment B. risk determination C. risk management D. risk reduction

Computer Science & Information Technology

____________________ is text which is aligned on both the right and left margins.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology