Complete C++/programming newb in need of help
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Thread: Complete C++/programming newb in need of help

  1. #1
    Join Date
    Aug 2009
    Posts
    6

    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.

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,888

    Re: Complete C++/programming newb in need of help

    That's "endl", lowercase L, not 1. It stands for "end line".

  3. #3
    Join Date
    Aug 2009
    Posts
    6

    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.

  4. #4
    Join Date
    Aug 2009
    Posts
    6

    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.

  5. #5
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,247

    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).
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  6. #6
    Join Date
    Aug 2007
    Posts
    858

    Re: Complete C++/programming newb in need of help

    Quote Originally Posted by laserlight View Post
    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.

  7. #7
    Join Date
    Aug 2009
    Posts
    6

    Re: Complete C++/programming newb in need of help

    Quote Originally Posted by laserlight View Post
    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?

  8. #8
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,888

    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.

  9. #9
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,247

    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.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  10. #10
    Join Date
    Aug 2009
    Posts
    6

    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
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center