Article View: att.lang.c++
Article #283can someone please help with compile error?
From: Vangeli
Date: Sun, 26 Oct 1997 00:00
Date: Sun, 26 Oct 1997 00:00
32 lines
1633 bytes
1633 bytes
I just recently purchased a book to learn how to program in C++ and tried to compile the following program out of that
book:
#include <iostream.h>
int main()
{
int x=5;
int y=7;
cout "\n";
cout <<x+y<<""<<x*y;
cout "\n";
return 0;
}
This is the same way it appears in the book and when I compiled it I got the following error messages:
Compiling...
ex1.cpp
C:\Msdev\bin\ex1.cpp(6) : error C2143: syntax error : missing ';' before 'string'
C:\Msdev\bin\ex1.cpp(8) : error C2143: syntax error : missing ';' before 'string'
Error executing cl.exe.
ex1.exe - 2 error(s), 0 warning(s)
Can someone please help me. Am I doing something wrong or is there a typo in the documentation?
The compiler I'm using is Microsoft Visual C++ 4.1. Any assistance will be greatly appreciated.
Regards
Vangeli
Vangeli@erols.com
Technical Details
Message-ID:
<345411F6.8099B23@crystalvision.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4ba,639f772a9c997d09,start X-Google-Attributes: gid10d4ba,public X-Google-Thread: 114592,639f772a9c997d09,start X-Google-Attributes: gid114592,public X-Google-Thread: 109b8e,639f772a9c997d09,start X-Google-Attributes: gid109b8e,public From: Vangeli <vangeli@crystalvision.net> Subject: can someone please help with compile error? Date: 1997/10/26 Message-ID: <345411F6.8099B23@crystalvision.net> X-Deja-AN: 285204541 X-Complaints-To: abuse@erols.com X-Trace: winter.news.erols.com 877924859 3558 207.172.206.41 (27 Oct 1997 04:00:59 GMT) Organization: Crystal Vision Web Studio Newsgroups: att.lang.c++,alt.comp.lang.learn.c-c++,microsoft.public.usasalesinfo.developer.visualc++