“int main (vooid)”? How does that work?

前端 未结 4 778
迷失自我
迷失自我 2020-12-22 20:31

I recently had to type in a small C test program and, in the process, I made a spelling mistake in the main function by accidentally using vooid instead of

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-22 21:34

    It is only gcc -std=c89 -Wall -o qq qq.c and gcc -std=gnu89 -Wall -o qq qq.c don't emit a warning. All the other standards emit a warning about implicit type int for vooid.

    int main(chart) behaves the same way as does int main (vooid).

    return vooid; returns the number of command line arguments.

    I tested with gcc 4.4.5 on Debian testing system.

提交回复
热议问题