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:

    Women are taught that their main goal in life is to serve others—first men, and later, children. This prescription leads to enormous problems, for it is supposed to be carried out as if women did not have needs of their own, as if one could serve others without simultaneously attending to one’s own interests and desires. Carried to its “perfection,” it produces the martyr syndrome or the smothering wife and mother.
    Jean Baker Miller (20th century)

    Literature does not exist in a vacuum. Writers as such have a definite social function exactly proportional to their ability as writers. This is their main use.
    Ezra Pound (1885–1972)