Thread: Syntax Error???

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    3

    Question Syntax Error???

    When i type in correct code and syntax and compile it, the compiler tells me that theres syntax and parse errors! What's wrong?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    You need to provide an example.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Jul 2005
    Posts
    3
    how bout a simple console app like this:

    Code:
    #include <iostream>
    
    using namespace std;
    
    int main();
    {
      cout<<"Hello!";
      cin.get;
    }
    there was a syntax error with '{' right after the main function
    Last edited by Maerus; 07-03-2005 at 12:19 AM.

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    >how bout a simple console app like this:
    >int main();
    How bout what's with the semicolon?

  5. #5
    Registered User
    Join Date
    Jul 2005
    Posts
    3
    heh, oops, common mistake!
    Last edited by Maerus; 07-03-2005 at 12:27 AM.

  6. #6
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Also it is cin.get() not cin.get.
    Woop?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 04:09 AM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  4. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 10:52 PM
  5. Linking error
    By DockyD in forum C++ Programming
    Replies: 10
    Last Post: 01-20-2003, 05:27 AM