What is the output of this C++ program in the “test.txt” file?
Posted: Wed Jul 13, 2022 7:53 pm
#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; }
a) This is an apple
b) apple
c) sample
d) This is a sample
a) This is an apple
b) apple
c) sample
d) This is a sample