Basic Errors

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • IgorZ
    New Member
    • Sep 2009
    • 11

    Basic Errors

    Hello I am a fellow student who wants to learn this programming language. Just fixed my program for coding in C++ so took some online tutorials and I started coding. I'm using Dev C++ program which i heard works very well but I don't know why it gives me such errors on so simple codes like the one presented below. If some 1 is generous enough to help me I will be glad.

    My code:
    Code:
    #include<iostream>
    using namespace std;
    
    int main()
    {
            cout << "Hello Everyone";
            system("PAUSE");
            return 0
    }
    Errors:
    Code:
     1. C:\Documents and Settings\User\Desktop\Untitled2.cpp In function `int main()': 
    2. 9 C:\Documents and Settings\User\Desktop\Untitled2.cpp expected `;' before '}' token 
    3.  C:\Documents and Settings\User\Desktop\Makefile.win [Build Error]  [Untitled2.o] Error 1
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Every statement must be terminated by a semi colon.

    Comment

    • IgorZ
      New Member
      • Sep 2009
      • 11

      #3
      What do u mean? Don't understand

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by IgorZ
        What do u mean? Don't understand
        You typed "return 0" and the compiler complains about it; make that "return 0;"

        kind regards,

        Jos

        Comment

        • donbock
          Recognized Expert Top Contributor
          • Mar 2008
          • 2427

          #5
          Line 8 needs a terminating semicolon.

          By the way, do you need to include an additional header file to support the system function?

          Comment

          Working...