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

main c 15 1 error expected declaration or statement at end of input
c compile error expected declaration or statement at end of input
c expected declaration or statement at end of input
declaration or statement expected at end of file
error: expected identifier or at end of input
expected declaration at the end
expected a declaration c
expected '' at end of input
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.


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.

Error: expected declaration or statement at end of input in C, Here, we will learn why an error expected declaration or statement at end of input is occurred and how to fix it? When I try to compile my code I get three errors all stating "error: expected declaration or statement at end of input" All pointing to the same line. The line changes depending on sections that I have commented out.


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.

error:expected declaration or statement at end of input, GO TO POST 6(is my new problem) { this solved. I am getting this message when i am trying to compile the code series1.c:44: σφάλμα:  C error: expected declaration or statement at end of input Asked 5 years ago 0 Alright, so from what I've seen, it seems these errors usually show up whenever there's a semicolon missing, or a misplaced curly-brace or something of that nature.


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

[Error] expected declaration or statement at end of input, [Error] expected declaration or statement at end of input. Code: [View]. void statistics (void) { int i,success=0; float stat=0; for (i=0;i<150;i++) { if  expected declaration or statement at end of output in a function Hot Network Questions What to do when a reviewer is late while daily posting about other activities on social media?


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

expected declaration or statement at end of input, [C] "Expected declaration or statement at end of input" Compiler Error. Solved. [​deleted]. Share6. 1. 6 Comments sorted byBest. Log in or sign up to leave a  Most probably an unbalanced } at the end of main. Otherwise there's a high chance of other errors. Otherwise there's a high chance of other errors. – Ricardo Cárdenes Jan 3 '12 at 4:31


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

[C] "Expected declaration or statement at end of input" Compiler Error, Can someone help me with my problem? c error help. 0 0. This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet.


expected declaration or statement at end , main.c: In function 'write': main.c:817: error: expected declaration or statement at end of input make.exe: *** [main.o] Error 1. Any idear how to  The error, as noted in the title is expected declaration before '}' token at the line noted in my opening paragraph.


expected declaration or statement at end of input, cp.c:37:1: error: expected declaration or statement at end of input. I've looked this over till I'm blue in the face and can't find an error in main. [Error] expected declaration or statement at end of input This problem occurs when I try to run that part of the program. expected declaration or statement at end


[SOLVED] expected declaration compiler error, We are trying to compile this program and we keep getting the same error, we can't find where the problem is can somenone help us please. Bonjour, je suis en train de m'exercer sur les fonction en faisant une calculatrice que n'utilise pour ainsi dire que des fonctions. Mais voila j'ai un problème du type expected declaration or statement at end of input.