Complete Novice doing something stupid
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Complete Novice doing something stupid

  1. #1
    Join Date
    May 2009
    Posts
    2

    Complete Novice doing something stupid

    Hi I have a file
    Hello.cpp (I said i was a novice).

    #include <iostream.h>
    int main()
    {
    int x = 5;
    int y = 7;
    cout "\n";
    cout << x + y << " " << x * y;
    cout "\n";
    return 0;
    }

    I try and run and compile it by running
    bcc32 -If:\Borland\bcc55\include -Lf:\Borland\bcc55\Lib Hello.cpp

    But am getting the following error
    Hello.cpp:
    Error E2379 Hello.cpp 6: Statement missing ; in function main()
    Error E2379 Hello.cpp 8: Statement missing ; in function main() *** 2 errors in Compile

    I apologise for the post but I really waqnt to get on and can't even get past this simple problem.

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,228

    Re: Complete Novice doing something stupid

    What do you see different in these two statements?

    cout "\n";
    cout << x + y << " " << x * y;

  3. #3
    Join Date
    May 2009
    Posts
    2

    Re: Complete Novice doing something stupid

    Apologies for the delay coming back Work comes first

    If I'm perfectly honest I don't see anything different except the question marks are around the /n
    in the first line and not the second line statement

    I know /n is a new line so expected the following result (once it compiled)

    12 35

    I'm sorry to be a hassle

  4. #4
    Join Date
    May 2006
    Location
    beyond the pillars of hercules
    Posts
    295

    Re: Complete Novice doing something stupid

    u forgot "<<"

    Code:
    cout << "\n";

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center