-
August 18th, 2009, 01:16 PM
#1
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.
Last edited by pentago; August 19th, 2009 at 10:44 AM.
-
August 18th, 2009, 01:17 PM
#2
Re: Complete C++/programming newb in need of help
That's "endl", lowercase L, not 1. It stands for "end line".
-
August 18th, 2009, 01:18 PM
#3
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.
-
August 18th, 2009, 01:20 PM
#4
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.
-
August 18th, 2009, 01:31 PM
#5
Re: Complete C++/programming newb in need of help
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.
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).
-
August 18th, 2009, 07:14 PM
#6
Re: Complete C++/programming newb in need of help
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.
-
August 19th, 2009, 10:43 AM
#7
Re: Complete C++/programming newb in need of help
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?
-
August 19th, 2009, 12:01 PM
#8
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.
-
August 19th, 2009, 12:08 PM
#9
Re: Complete C++/programming newb in need of help
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.
-
August 19th, 2009, 01:41 PM
#10
Re: Complete C++/programming newb in need of help
Alright, figured it out. Thanks guys.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|