更新时间:2023-11-18 15:28:46
通常,在每个C或C ++程序开始执行code(包括通常由编译器/链接默认)做了一些初始化和然后调用一个名为主要功能
。如果该函数不present,它将链接的程序(其中所有的名字必须解决)时导致一个悬而未决的名称。如果是present,它会被程序初始化code被调用。
Generally, the code that is executed at the beginning of every C or C++ program (included usually by default by compilers/linkers) does some initialization and then calls a function called main
. If this function is not present, it will lead to an unresolved name when linking a program (in which all the names have to be resolved). If it is present, it will be called by the program initialization code.
初始化code做一些家务(例如,转换的主要功能为程序的退出code中的返回值,等等。)
The initialization code does some housekeeping (for example, converts the return value of the main function to the exit code of the program, etc.)