ExamVeda
Login
Home
C plus plus miscellaneous
?

What is the output of this C++ program in the "test.txt" file?
#include <fstream>
using namespace std;
int main ()
{
    long pos;
    ofstream outfile;
    outfile.open ("test.txt");
    outfile.write ("This is an apple",16);
    pos = outfile.tellp();
    outfile.seekp (pos - 7);
    outfile.write (" sam", 4);
    outfile.close();
    return 0;
}

Answer & Solution
Correct Answer: Option D
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.