Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <stdlib.h>
  4. using namespace std;
  5. void set_content_type(string content_type) {
  6. cout << “Content-type: “ << content_type << “\r\n\r\n”;
  7. }
  8. void set_page_title(string title) {
  9. cout << “<title>” << title << “</title>\n”;
  10. }
  11. void h1_text(string text) {
  12. cout << text << “\n”;
  13. }
  14. int main() {
  15. set_content_type(“text/html”);
  16. // Output HTML boilerplate
  17. cout << “<!doctype html>\n”;
  18. cout << “<html lang=\”en\”>\n”;
  19. cout << “<head>\n”;
  20. set_page_title(“Hello, World!”);
  21. cout << “</head>\n”;
  22. cout << “<body>\n”;
  23. h1_text(“Hello, World!”);
  24. cout << “</body>\n”;
  25. cout << “</html>”;
  26. return 0;
  27. }
  28. FROM https://blog.sourcerer.io/building-a-website-with-c-db942c801aee
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement