return to the operating system, otherwise the processor will simply continue executing beyond the end of the program, resulting in undefined behavior. Usually, there is not a single exit point specified in a program. However, in other cases runtimes ensure that programs always terminate in a structured way via a single exit point, which is guaranteed unless the runtime itself crashes; this allows cleanup code to be run, such as atexit handlers. This can be done by either requiring that programs terminate by returning from the main function, by calling a specific exit function, or by the runtime catching exceptions or operating system signals. Programming languages In many programming languages, the main function is where a program starts its execution. It enables high-level organization of the program's functionality, and typically has access to the command arguments given to the program when it was executed. The main function is generally the first programmer-written function that runs when a program starts, and is invoked directly from the system-specific initialization contained in the runtime environment (crt0 or equivalent). However, some languages can execute user-written functions before main runs, such as the constructors of C++ global objects. In other languages, notably many interpreted languages, execution begins at the first statement in the program. A non-exhaustive list of programming languages follows, describing their way of defining the main entry point: APL In APL, when a workspace is loaded, the contents of "quad LX" (latent expression) variable is interpreted as an APL expression and executed. C and C++ In C and C++, the function prototype of the main function looks like one of the following: int main(void); int main(); int main(int argc, char **argv); int main(int argc, char *argv[]); int main(int argc, char **argv, char **env); // more specifically in C // NOT according to the ISO C standard 5.1.2.2.1 // BUT in embedded programming depending on the µC, this form is also used void main (void); Main function looks like entry point for application programmers (the application's entry point or main entry point). System programming reveals more information about the program, and specifies the entry point elsewhere (in initialization procedure, or in reset interrupt vector for standalone programs). The parameters argc, argument count, and argv, argument vector, respectively give the number and values of the program's command-line arguments. The names of argc and argv may be any valid identifier in C, but it is common