Current location - Recipe Complete Network - Dinner recipes - C language stipulates that in a source program, the location of the main function
C language stipulates that in a source program, the location of the main function
The location of the main function must be after the library function called by the system. Main function, also known as main function, is the starting point of program execution. main is relative, just like the main tone of phonology theory is overtone, which is other functions in the program except main, which caters to people's way of thinking and is not a certain pattern.

This topic is really B. Many people choose C because it is partial. If C is correct, it should be said that the position of the main function is anywhere after the library function called by the system, which is correct.

Extended data:

In C language, a program, whether complex or simple, is a "function" on the whole; This function is called "main () function", that is, "main function". For example, if there is a "cooking" program, then the process of "cooking" is the "main function". In the main function, depending on the situation, you may also need to call sub-functions such as "buy vegetables, cut vegetables, stir-fry".

The main function must exist in most programs, but there are still exceptions. For example, a dynamic link library (dll) module can be written in windows programming, which is the code that other windows programs can use. Because the DLL module is not an independent program, the main function is not needed. For another example, a program used in a professional environment-such as a control chip in a robot-may not need the main function.

References:

Main function Baidu encyclopedia