[c] error: expected declaration or statement at end of input in c

void mi_start_curr_serv(void){
#if 0
 //stmt
#endif    
}

I'm getting an error as "error: expected declaration or statement at end of input" in my compiler. I could not find any error with the above function. Please help me to understand this error.

This question is related to c

The answer is


For me I just noticed that it was my .h archive with a '{'. Maye that can help someone =)


You probably have syntax error. You most likely forgot to put a } or ; somewhere above this function.


Try to place a

return 0;

on the end of your code or just erase the

void

from your main function I hope that I helped


For me this problem was caused by a missing ) at the end of an if statement in a function called by the function the error was reported as from. Try scrolling up in the output to find the first error reported by the compiler. Fixing that error may fix this error.