ahmed0saber

Create an HTML file in C++

Nov 5th, 2020
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <fstream>
  2. using namespace std;
  3. int main()
  4. {
  5.   ofstream MyFile("filename.html");
  6.   MyFile << "<!DOCTYPE html><html><body><h1 style=color:blue;>A Blue Heading</h1><p style=color:red;>A red paragraph.</p></body></html>";
  7.   MyFile.close();
  8. }
Advertisement
Add Comment
Please, Sign In to add comment