problem with functions and "parse errors"

This is a discussion on problem with functions and "parse errors" within the C++ Programming forums, part of the General Programming Boards category; I created a program with a function, but it keeps on saying "37: parse error before `int' " heres line ...

  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,825
    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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21