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:
“Greece is a sort of American vassal; the Netherlands is the country of American bases that grow like tulip bulbs; Cuba is the main sugar plantation of the American monopolies; Turkey is prepared to kow-tow before any United States pro-consul and Canada is the boring second fiddle in the American symphony.”
—Andrei Andreyevich Gromyko (19091989)
“Of all the inhabitants of the inferno, none but Lucifer knows that hell is hell, and the secret function of purgatory is to make of heaven an effective reality.”
—Arnold Bennett (18671931)