Weird errors

Discussion in 'Mac Programming' started by Halfmaster1, Dec 29, 2010.

  1. Halfmaster1 macrumors newbie

    Joined:
    Dec 28, 2010
    #1
    I'm setting up code for a prime number generator.

    Now, I have all the code fine, but I'm getting a weird error.


    Code:
    #include <stdio.h>
    #include <stdbool.h>
    
    bool IsItPrime(int testPrime)
    
    int main (int argc, const char * argv[])
    { //Expected '=', ',', 'asm' or '_attribute_' before '{' token
    
    //More code, calling of the IsItPrime function, declaration of testPrime
    	
    return 0
    	
    } //Expected '{' at end of input
    
    
    
    
    bool IsItPrime(int testPrime)
    { //Expected '=', ',', 'asm' or '_attribute_' before '{' token
    
    //some code, with a while loop and an if statement. Declaration of a few variables only used in this.
    
    } //Expected '{' at end of input
    
    
    
    A few comments are errors, I think you can tell which ones.

    So, I have no idea how to fix this.

    Any ideas?
    Thanks.
     
  2. ncl macrumors member

    Joined:
    Aug 16, 2008
    #2
    4th line:
    Code:
    bool IsItPrime(int testPrime)[SIZE="5"][b];[/b][/SIZE]
    
     
  3. McGordon macrumors member

    Joined:
    Dec 28, 2010
    Location:
    Scotland
    #3
    Another missed semicolon after the return statement.
     
  4. Halfmaster1 thread starter macrumors newbie

    Joined:
    Dec 28, 2010
    #4
    Thanks, found a lot of missing ; in my code. It works now.
     

Share This Page