error C2143: syntax error : missing ';' before 'type'

前端 未结 3 899
有刺的猬
有刺的猬 2020-12-01 17:55

I am new to programming C.. please tell me what is wrong with this program, and why I am getting this error: error C2143: syntax error : missing \';\' before \'type\

3条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-01 18:28

    I haven't used visual in at least 8 years, but it seems that Visual's limited C compiler support does not allow mixed code and variables. Is the line of the error on the declaration for int i=1; ?? Try moving it above the call to func();

    Also, I would use extern void func(void);

提交回复
热议问题