Question #272972

Write C++ program to write “Hello World" inside file in path D:\output\os.txt then calculate the size of that file.


Expert's answer

#include<fstream>
int main() {
  std::ofstream file("D:\output\os.txt");
  file << "Hello World";
  printf("%zu", file.tellg())
  file.close();
  return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS