Is a main() required for a C program?

后端 未结 7 459
后悔当初
后悔当初 2020-12-15 03:13

Well the title says it all. Is a main() function absolutely essential for a C program?

I am asking this because I was looking at the Linux kernel code,

7条回答
  •  一向
    一向 (楼主)
    2020-12-15 03:53

    The main() function is called by an object file included with the libc. Since the kernel doesn't link against the libc it has its own entry point, written in assembler.

提交回复
热议问题