• ( 2 ) Which among is used for positioning relative to the beginning of a stream ?

    • 1) iso::start
    • 2) ios::beg
    • 3) ios::begin
    • 4) iso::beginning
    • Discussion in forum
      Answer : 2) ios::beg
      Solution :








      discussion


      Answer : 2) ios::beg

    • ( 3 ) An inverted file

    • 1) Locates information about data in small files that are maintained apart from actual data record
    • 2) A file which stores opposite records
    • 3) A file which stores information about records of a system
    • 4) None of these
    • Discussion in forum
      Answer : 2) A file which stores opposite records
      Solution :








      discussion


      Answer : 2) A file which stores opposite records

    • ( 4 ) Which of the following fopen statements are illegal?

    • 1) fp = fopen("abc.txt", "r");
    • 2) fp = fopen("/home/user1/abc.txt", "w");
    • 3) fp = fopen("abc", "w");
    • 4) None of these
    • Discussion in forum
      Answer : 4) None of these
      Solution :








      discussion


      Answer : 4) None of these

    • ( 5 ) What is the output of this program?
      #include
      #include
      using namespace std;
      int main ()
      {
      ofstream outfile ("test.txt");
      for (int n = 0; n < 100; n++)
      {
      outfile << n;
      outfile.flush();
      }
      cout << "Done";
      outfile.close();
      return 0;
      }

    • 1) Done
    • 2) Error
    • 3) Runtime error
    • 4) None of these
    • Discussion in forum
      Answer : 1) Done
      Solution :








      discussion


      Answer : 1) Done

    • ( 6 ) Which of the following is used for read operations?

    • 1) ifstream
    • 2) ofstream
    • 3) fstream
    • 4) None of these
    • Discussion in forum
      Answer : 1) ifstream
      Solution :








      discussion


      Answer : 1) ifstream

    • ( 7 ) How to go backward by m bytes from the current position?

    • 1) fout . seekg(m, ios :: cur)
    • 2) fout . seekg(0, ios :: cur)
    • 3) fout . seekg(-m, ios :: cur)
    • 4) None of these
    • Discussion in forum
      Answer : 3) fout . seekg(-m, ios :: cur)
      Solution :








      discussion


      Answer : 3) fout . seekg(-m, ios :: cur)

    • ( 10 ) Which function is ued to go backward by m bytes from the end?

    • 1) fout . seekg(-m, ios :: end)
    • 2) fout . seekg(0, ios :: end)
    • 3) fout . seekg(m, end)
    • 4) None of these
    • Discussion in forum
      Answer : 1) fout . seekg(-m, ios :: end)
      Solution :








      discussion


      Answer : 1) fout . seekg(-m, ios :: end)





Top