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

Total
0
Shares
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.


Solution

Normally that error occurs when a } was missed somewhere in the code, for example:

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

would fail with this error due to the missing } at the end of the function. The code you posted doesn’t have this error, so it is likely coming from some other part of your source.

Source: StackOverflow.com

Leave a Reply

Your email address will not be published. Required fields are marked *