Main Function

In many programming languages, the main function is where a program starts execution. It is responsible for the high-level organization of the program's functionality, and typically has access to the command arguments given to the program when it was executed. Thus main is very important to run your code.

The main function is generally the first programmer-written function run when a program starts, and is invoked directly from the system-specific initialization contained in crt0 or equivalent. However, some languages can execute user-written functions before main runs, such as the constructors of C++ global objects.

Famous quotes containing the words main and/or function:

    The main facts in human life are five: birth, food, sleep, love and death.
    —E.M. (Edward Morgan)

    Any translation which intends to perform a transmitting function cannot transmit anything but information—hence, something inessential. This is the hallmark of bad translations.
    Walter Benjamin (1892–1940)