Thread: problem with functions and "parse errors"

  1. #1
    wierd guy bart's Avatar
    Join Date
    Aug 2001
    Posts
    87

    Unhappy problem with functions and "parse errors"

    I created a program with a function, but it keeps on saying


    "37: parse error before `int' "

    heres line 34 to 39

    getch();
    return 0;
    }
    int randomNum()
    {
    srand(time(NULL));

    can anyone help?

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    you are probably missing or got one too many { or }
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    Post the rest of the program - it'll really help in debugging it (note: use the code tages to post - it makes it so much easier to read and preserves indentation)

  4. #4
    wierd guy bart's Avatar
    Join Date
    Aug 2001
    Posts
    87
    thanks! i just missed a }.

Popular pages Recent additions subscribe to a feed