How to not invoke warning: type specifier missing?

假装没事ソ 提交于 2019-12-01 19:56:29

Just give main a return type:

int main()

and make sure to add return 0; as the last statement.

You can either tell the compiler to use the C language standard C90 (ANSI), which was modern when the book was written. Do it by using parameter -std=c90 or -ansi to the compiler, like this:

cc -ansi FtoC.c -o FtoC.o

or you can rewrite the program to adhere to a newer standard (C99), which is what your compiler uses by default, by adding a return type to the main function, like this:

int main()

You should give return type for the main function. By default it takes int as its return type.

Either try,

int main() {
  //.....
return some_int_value;
}

Use int main() the function should return a value i.e. 0

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