Keep getting this compiling error [closed]

妖精的绣舞 提交于 2019-12-04 07:15:46

问题


When I compile, I keep getting this error.

mario.c:4:1: error: expected identifier or '('

I've tried changing things and then fixing them and changing other things and then fixing those but nothing seems to help. I'm new at this. Can anyone help?

#include <stdio.h>
#include <cs50.h>
int main(void);
{
int n;

    do 
   { 
    n = GetInt();
   }
    while (n=<0);
}

回答1:


Change

int main(void);  
              ^Remove the semicolon 

to

int main(void)  

and also change

while (n=<0);  

to

while (n <= 0);


来源:https://stackoverflow.com/questions/21914660/keep-getting-this-compiling-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!