The Daily Click ::. Forums ::. Non-Klik Coding Help ::. C++ Help!
 

Post Reply  Post Oekaki 
 

Posted By Message

Jack Galilee



Registered
  02/12/2002
Points
  990

VIP Member
10th July, 2005 at 10:20:14 -

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?

Image Edited by the Author.

Image Edited by the Author.

 
The only thing better than winning gold in the paralympics is not being retarted

Jack Galilee



Registered
  02/12/2002
Points
  990

VIP Member
10th July, 2005 at 11:06:22 -

wait no, dont worry false alarm I found my code errors!

 
The only thing better than winning gold in the paralympics is not being retarted

a1018



Registered
  08/02/2005
Points
  131
10th July, 2005 at 12:09:19 -

#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;
}

//right????

 


a1018



Registered
  08/02/2005
Points
  131
10th July, 2005 at 12:11:04 -

Plus i am using devc++.(www.bloodshed.net)----FREEWARE.......

 


a1018



Registered
  08/02/2005
Points
  131
10th July, 2005 at 12:30:28 -

I start writing before him&&& uploded after him you ....

 


a1018



Registered
  08/02/2005
Points
  131
10th July, 2005 at 12:39:35 -

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 ____???

 


Jack Galilee



Registered
  02/12/2002
Points
  990

VIP Member
11th July, 2005 at 03:28:04 -

uh... actually I just fixed it by adding

using namespace std;

before all the code :S

 
The only thing better than winning gold in the paralympics is not being retarted
   

Post Reply



 



Advertisement

Worth A Click