download Mastguru Android App

Question Detail

Which is correct syntax ?

  • myfile:open ("example.bin", ios::out);
  • myfile.open ("example.bin", ios::out);
  • myfile::open ("example.bin", ios::out);
  • myfile.open ("example.bin", ios:out);
Similar Questions :

1. How to get position to the nth byte of fileObject ?

  • fileObject.seekg( 'filename',n );
  • fileObject.seekg( n, 'filename' );
  • fileObject.seekg( n );
  • fileObject.seekg( n, ios::app );

2. Which is among following is used to Open a file for output and move the read/write control to the end of the file ?

  • ios::ate
  • ios::at
  • ios::ann
  • ios::end

3. Which stream class is to only read from files ?

  • ofstream
  • ifstream
  • fstream
  • iostream

4. How to get position n bytes forward in fileObject ?

  • fileObject.seekg( ios::cur, n );
  • fileObject.seekg( n, ios:cur );
  • fileObject.seekg( n, ios::cur );
  • fileObject.seekg( ios:cur, n );

5. Which among is used for positioning relative to the beginning of a stream ?

  • ios::start
  • ios::beg
  • ios::begin
  • ios::beginning
Read more from - C++ File Handling Questions Answers
Post a comment