I'm reading a book on C++ and this is the first simple quiz question...
it says run this and guess what it does, now i know what it does but it wont compile.
on DEV C++ it says - 3 C:\Documents and Settings\Reece.LAPTOP\Desktop\test.cpp expected unqualified-id before '{' tokenCode:#include <iostream> int main(); { int x = 5; int y = 7; cout "\n"; cout << x + y << " " << x * y; cout "\n"; return 0; }
3 C:\Documents and Settings\Reece.LAPTOP\Desktop\test.cpp expected `,' or `;' before '{' token
and on Visual C++ Express Edition it says
Compiling...
tester.cpp
.\tester.cpp(3) : error C2447: '{' : missing function header (old-style formal list?)
Build log was saved at "file://c:\Documents and Settings\Reece.LAPTOP\My Documents\Visual Studio 2005\Projects\tester\tester\Debug\BuildLog.htm"
tester - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
can someone please just tell me whats wrong cuz its really winding me up because its soo simple.