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.

You are watching: Expected declaration or statement at end of input


*

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

void mi_start_curr_serv(void) #if 0 //stmt #endifwould 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.


*

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.


*

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

See more: Love Me Don T Leave Me, Don'T Leave Me, Love Me, Don'T Leave Me


*

*

For me it was a missing } bracket in a function called by the code where the error was reported. Was also reported on code calling the function that called the function missing the }. So can be hard to find if you do not know what you are looking for.


Try to place a

return 0;

on the end of your code or just erase the

void

from your main functionI hope that I helped


Highly active question. Earn 10 reputation (not counting the association bonus) in order to answer this question. The reputation requirement helps protect this question from spam and non-answer activity.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev2021.11.19.40795


Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.