Hey, I've basically just started learning C++ now in the book ive got Sams teach yourself C++ in 21 days, there is an exercise at the end of day 1, now I wrote out the exercise into my compiler (Visual C++ 2005 Express Beta 2) the code is as follows:
line 1:#include <iostream>
line 2: int main()
line 3: {
line 4: int x = 5;
line 5: int y = 7;
line 6: std::cout << endl;
line 7: std::cout << x + y << " " << x * y;
line 8: std::cout << end;
line 9: return 0;
line 10: }
thats exactly what the book has!..
I get 2 errors, the following is my output box:
------ Build started: Project: My 2nd Application, Configuration: Debug Win32 ------
Compiling...
My 2nd Application.cpp
c:\documents and settings\spasticus_xiii\my documents\visual studio 2005\projects\my 2nd application\my 2nd application\my 2nd application.cpp( 6 ) : error C2065: 'endl' : undeclared identifier
c:\documents and settings\spasticus_xiii\my documents\visual studio 2005\projects\my 2nd application\my 2nd application\my 2nd application.cpp( 8 ) : error C2065: 'end' : undeclared identifier
Build log was saved at "file://c:\Documents and Settings\Spasticus_XIII\My Documents\Visual Studio 2005\Projects\My 2nd Application\My 2nd Application\Debug\BuildLog.htm"
My 2nd Application - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
so Im getting an error suposedly at line 6 and line 8
I've also tried the same script in Borland C++ BuilderX Enterprise Edition, and I get an error just like the above! what am I doing wrong?
Edited by the Author.
Edited by the Author.
The only thing better than winning gold in the paralympics is not being retarted
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int x = 5;
int y = 7;
//std::cout << endl;
std::cout << x + y << " " << x * y;
//Sleep (1000);//for see the text
//std::cout << end;
system("PAUSE");
return EXIT_SUCCESS;
}
readin his post ---- betw 2-3 mins
Open devc----betw 0-1 mins
write codes----betw 5-6 mins
compile&test----betw 1-2 mins
reply from turkey----betw 2-3 mins
Did you really do ____???