Write C++ program to write “Hello World" inside file in path D:\output\os.txt then calculate the size of that file.
#include<fstream>
int main() {
std::ofstream file("D:\output\os.txt");
file << "Hello World";
printf("%zu", file.tellg())
file.close();
return 0;
}
Comments
Leave a comment