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:
“One of the main tasks of adolescence is to achieve an identitynot necessarily a knowledge of who we are, but a clarification of the range of what we might become, a set of self-references by which we can make sense of our responses, and justify our decisions and goals.”
—Terri Apter (20th century)
“The more books we read, the clearer it becomes that the true function of a writer is to produce a masterpiece and that no other task is of any consequence.”
—Cyril Connolly (19031974)