Answer to Question #272972 in C++ for Baneen

Question #272972

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


1
Expert's answer
2021-11-29T00:00:33-0500
#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS