int main(int nNumberofArgs, char* pszArgs[]); void mainmenu (int*); { int i; if(strlen(key)!=10)
error: expected unqualified-id before ' { ' token
can anyone help me figure this out. its the only error in code. thanks
Printable View
int main(int nNumberofArgs, char* pszArgs[]); void mainmenu (int*); { int i; if(strlen(key)!=10)
error: expected unqualified-id before ' { ' token
can anyone help me figure this out. its the only error in code. thanks
Egad's man! How are you supposed to let the compiler tell you which line the errors are on, if all the errors are on the same line!?
Typically main starts and ends with curly braces {}, like so:
Your function prototypes should either be included with a header file, or in the same file before main, or you can just have the functions themselves before main. Functions are like main in terms of how they use brackets and curly braces:Code:int main()
{
/* function calls and other code here */
return 0;
}
Code:int some_func(int var1, int var2)
{
return var1 + var2;
}
At the very least there's a semi-colon that doesn't belong.