I thought I had the best idea. It was to create a cheap lookin' HTML editor by creating a text file which had HTML code in it and place .html on the end to create it an HTML document. I wrote all of the code (including some cool comments in the HTML ) but...I got these <b>confusing</b> error messages from MSVC++. Here is the code:
// tryin' to make a cheap-ass HTML editor...
#include <iostream.h>
#include <fstream.h>
#include <string.h>
#include <stdlib.h>
int main()
{
cout << "***********************************************\n ";
cout << " Welcome to ChrisHTML version 0.5\n";
cout << "***********************************************\n ";
cout << "\nThis program only sets the title, the background\n";
cout << "colour and the text colour - don't expect anything\n";
cout << "that slightly resembles an HTML editor at all becuase\n";
cout << "Chris Pocock wrote this crap that you are looking at right now\n";
char title[50];
cout << "Enter the title for you page: ";
cin.getline(title, 50);
cout << "\n";
unsigned bgcolor;
cout << "Enter what colour-code for your background: ";
cin >> bgcolor;
cout << "\n";
unsigned textcolor;
cout << "Enter the colour for the text: ";
cin >> textcolor;
cout << "\n";
ofstream output;
output.open("ChrisHTML.html");
output << "<!--Generated by ChrisHTML 0.5-->\n";
output << "<HTML>\n";
output << "<HEAD>\n";
output << "<TITLE>";
output << title;
output << <TITLE>\n";
output << "<meta name="GENERATOR" content="ChrisHTML 0.5">
output << "</HEAD>";
output << "<BODY ";
output << bgcolor=";
output << bgcolor;
output << " text=";
output << text;
output << " >\n";
output << "<h2>See source for main body<h2>\n";
output << "\n<!--You know how cheap Chris is...he would never";
output << "bother to actually let you create the main body of the";
output << "document, so you are going to have to add it all yourself-->\";
output << "</BODY>\n";
output << "</HTML>\n";
output.close;
cout << "HTML page created...go take a look!\n";
return 0;
}
...and here are the errors
Deleting intermediate files and output files for project 'HTML editor - Win32 Debug'.
--------------------Configuration: HTML editor - Win32 Debug--------------------
Compiling...
main.cpp
c:\program files\microsoft visual studio\myprojects\html editor\main.cpp(42) : error C2059: syntax error : '<'
c:\program files\microsoft visual studio\myprojects\html editor\main.cpp(42) : error C2017: illegal escape sequence
c:\program files\microsoft visual studio\myprojects\html editor\main.cpp(42) : error C2001: newline in constant
c:\program files\microsoft visual studio\myprojects\html editor\main.cpp(43) : error C2001: newline in constant
c:\program files\microsoft visual studio\myprojects\html editor\main.cpp(46) : error C2001: newline in constant
c:\program files\microsoft visual studio\myprojects\html editor\main.cpp(47) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'char [2]' (or there is no acceptable conversion)
c:\program files\microsoft visual studio\myprojects\html editor\main.cpp(47) : error C2146: syntax error : missing ';' before identifier 'output'
c:\program files\microsoft visual studio\myprojects\html editor\main.cpp(54) : error C2001: newline in constant
c:\program files\microsoft visual studio\myprojects\html editor\main.cpp(55) : error C2146: syntax error : missing ';' before identifier 'output'
c:\program files\microsoft visual studio\myprojects\html editor\main.cpp(59) : warning C4551: function call missing argument list
Error executing cl.exe.
HTML editor.exe - 9 error(s), 1 warning(s)
Could somebody please help me
Thanks heaps
-Chris