I got the error syntax error before string constant what do I do about it?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • David Knock
    New Member
    • Dec 2010
    • 1

    #1

    I got the error syntax error before string constant what do I do about it?

    I am a noob and was wondering how to fix this problem Error: syntax error before string constant I am trying to write the simple hello world code
    here it is

    #include "stdlib.h"

    int main ()
    "using namespace std;"
    {
    cout << "hello world!" ;
    cin.get ();
    return 0;
    }
    I copyed off a tutorial from youtube and I am not sure how to get it working
  • whodgson
    Contributor
    • Jan 2007
    • 542

    #2
    i think "using namespace std" should be declared above the main function

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      Nope.

      using namespace std is in the correct spot.

      However, it is not a string so remove the quotes.

      Comment

      Working...