-
What is the output of this program in the “Example.txt” file?
#include <fstream>
using namespace std;
int main ()
{
long pos;
ofstream outfile;
outfile.open ("Example.txt");
outfile.write ("This is a Sample",16);
pos = outfile.tellp();
outfile.seekp (pos - 7);
outfile.write (" Ex", 6);
outfile.close();
return 0;
}
-
- This is a Sample
- Ex
- Example.txt
- This is a Example
- None of these
Correct Option: D
In this program, We are changing the ap to sam by using the pos function.