Hell sluggers,

I've finally decided to pull my finger out and *try to* learn c++.

Stumbling blocks like these are a pain in the Arse, maybe someone can 
enlighten me as to why this error occurs:

** program:

 #include <iostream.h>
 
 int main()
 {
    int x = 5;
    int y = 7;
    cout << x + y " " x * y;
    cout << "\n";
    return 0;
 }
 

** error message:

 [EMAIL PROTECTED] c++]$ make xycout
g++     xycout.cpp   -o xycout
In file included from /usr/include/c++/3.3.2/backward/iostream.h:31,
                 from xycout.cpp:1:
/usr/include/c++/3.3.2/backward/backward_warning.h:32:2: warning: #warning 
This file includes at least one deprecated or antiquated header. Please 
consider using one of the 32 headers found in section 17.4.1.2 of the C++ 
standard. Examples include substituting the <X> header for the <X.h> header 
for C++ includes, or <sstream> instead of the deprecated header 
<strstream.h>. To disable this warning use -Wno-deprecated.
xycout.cpp: In function `int main()':
xycout.cpp:7: error: syntax error before string constant
xycout.cpp:12:1: warning: no newline at end of file
make: *** [xycout] Error 1
[EMAIL PROTECTED] c++]$

** I'm not worried about the antiquated header, The syntax is the issue. I've 
tried all sorts of mods to the syntax and cannot get it to go away, the 
program is a 'cut and paste' straight out of a text book, but it does not 
work! (while student is programming; writeln f..k). I assume this is normal 
practice, to publish inaccurate and unusable programs so some schmuck spends 
hours sorting it out...

Looking forward to your advice.

Thanks in advance,

Nick Tomlin.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to