Does the program execution always start from main in C?

前端 未结 3 1591
旧巷少年郎
旧巷少年郎 2020-12-10 09:37

Must program execution start from main, or can the starting address be modified?

#include 

void fun();

#pragma startup fun

int main()
{
            


        
3条回答
  •  没有蜡笔的小新
    2020-12-10 09:52

    As far as the ISO C Standard is concerned, the entry point for a C program is always main (unless some implementation-defined feature is used to override it) for a hosted implementation. For a "freestanding implementation" (typically an embedded system, often with no operating system), the entry point is implementation-defined.

提交回复
热议问题