Complete C++/programming newb in need of help
Code:
int main()
{
int x = 5;
int y = 7;
std::cout << std::end1;
std::cout << x + y << x * y;
std::cout << std::end1;
char response;
std::cin >> response;
return 0;
}
I'm writing code out of a book for an exercise (this is literally the second one I've ever written, after Hello World). I can't find any typos after looking it over again and again, but for some reason it won't compile. The compiler error message reads 6 C:\Dev-Cpp\Examples\Untitled2.cpp `end1' is not a member of `std'. The same reads for line 8. I'm kind of confused here, since I wrote it exactly how it is in the book. Any and all help is deeply appreciated.
Re: Complete C++/programming newb in need of help
That's "endl", lowercase L, not 1. It stands for "end line".
Re: Complete C++/programming newb in need of help
Oh yeah, and I'm using Dev-C++ 5.0 beta 9.2 (4.9.9.2) (9.0 MB) with Mingw/GCC. Recommendations for a better one are also welcome.
Re: Complete C++/programming newb in need of help
Okay, new problem. C:\Dev-Cpp\Makefile.win [Build Error] [hello.exe] error 1 ... same line.
Re: Complete C++/programming newb in need of help
Quote:
Originally Posted by pentago
Oh yeah, and I'm using Dev-C++ 5.0 beta 9.2 (4.9.9.2) (9.0 MB) with Mingw/GCC. Recommendations for a better one are also welcome.
It is fine, at least once you turn off the smart tabs feature. You could also consider using that compiler (or the 4.4.0 version directly from MinGW) with Code::Blocks, or perhaps Microsoft Visual C++ 2008 Express.
Quote:
Originally Posted by pentago
Okay, new problem. C:\Dev-Cpp\Makefile.win [Build Error] [hello.exe] error 1 ... same line.
What is the exact error message? Note that you did not #include <iostream>.
By the way, please post your code in [code][/code] bbcode tags. You might also want to post your non-Visual C++ issues in the appropriate forum (but leave this one for the moderators to move, if they see fit to do so).
Re: Complete C++/programming newb in need of help
Quote:
Originally Posted by
laserlight
It is fine, at least once you turn off the smart tabs feature. You could also consider using that compiler (or the 4.4.0 version directly from
MinGW) with
Code::Blocks, or perhaps Microsoft Visual C++ 2008 Express.
I tend to agree with "Why you shouldn't use Dev-C++". Given the other free options available, there's really no reason to use it today.
Re: Complete C++/programming newb in need of help
Quote:
Originally Posted by
laserlight
What is the exact error message? Note that you did not #include <iostream>.
I told you the exact error message (I think). I hit compile and it says C:\Dev-Cpp\Makefile.win [Build Error] [hello.exe] Error 1. I don't know what else to add. What does that mean?
Re: Complete C++/programming newb in need of help
There should be details of the error including a line number somewhere. Can't say where it would be since I'm not familiar with that compiler.
Re: Complete C++/programming newb in need of help
Quote:
Originally Posted by pentago
I told you the exact error message (I think). I hit compile and it says C:\Dev-Cpp\Makefile.win [Build Error] [hello.exe] Error 1. I don't know what else to add. What does that mean?
My guess is that you tried to compile a file that was not part of the current project.
Re: Complete C++/programming newb in need of help
Alright, figured it out. Thanks guys.