[cs23021] Re: Project 2

Mikhail Nesterenko mikhail at cs.kent.edu
Mon Sep 24 11:44:28 EDT 2007


> 
> Here is what i put into the output of the program:
> 
>         cout << "<table>\n";
>         
>         // printing the values 3 per line
>         cout << <td><font color=red> one </font></td>;
>         cout << ' '  << two << ' '  << three << ' ' << endl;
>         cout << four << ' ' << five << ' ' << six << ' ' << endl;
>         cout << seven << ' ' << eight  << ' ' << nine << ' ' << endl;
>         
>         cout << "</table>\n";
> 
> 
> It comes up with a bunch of error messages.  I don't understand how the
> table is supposed to be put into the program.  Now i know that the above
> isn't correct with the red color, but i was just using it to see if it
> would work.  It says that tr and td aren't declared in the scope.  I
> thought that they were just accepted by the program as tags since
> they're between  < >.

Note that <tr> and <td> are HTML tags, they are not legitimate C++
constructs. For a C++ program, these HTML tags are just constant
strings to be output. In C++ strings are supposed to be included in
double quotes. Note how <table> is output.

thanks,
-- 
Mikhail


More information about the cs23021 mailing list