Entry point

Example of the main function, in C#.
How the Main() might look in C# source code. Different parts are labeled for reference.

In computer programming, an entry point is the place in a program where the execution of a program begins, and where the program has access to command line arguments.[failed verification][1]

To start a program's execution, the loader or operating system passes control to its entry point. (During booting, the operating system itself is the program). This marks the transition from load time (and dynamic link time, if present) to run time.

For some operating systems and programming languages, the entry point is in a runtime library, a set of support functions for the language. The library code initializes the program and then passes control to the program proper. In other cases, the program may initialize the runtime library itself.[2]

In simple systems, execution begins at the first statement, which is common in interpreted languages, simple executable formats, and boot loaders. In other cases, the entry point is at some other known memory address which can be an absolute address or relative address (offset).

Alternatively, execution of a program can begin at a named point, either with a conventional name defined by the programming language or operating system or at a caller-specified name. In many C-family languages, this is a function called main; as a result, the entry point is often known as the main function.[3]

In JVM languages, such as Java, the entry point is a static method called main; in CLI languages such as C# the entry point is a static method named Main.[4]

  1. ^ "In Computing, what is an Entry Point? (with picture)". wiseGEEK. Archived from the original on 2020-08-05. Retrieved 2020-01-22.
  2. ^ Decker, Karsten M.; Rehmann, René M. (1994). Programming Environments for Massively Parallel Distributed Systems: Working Conference of the Ifip Wg 10.3, April 25-29, 1994. Springer Science & Business Media. ISBN 978-3-7643-5090-1.
  3. ^ "Main Method in C#". GeeksforGeeks. 2018-11-30. Archived from the original on 2020-07-31. Retrieved 2020-01-22.
  4. ^ Wagner, Bill (2017-08-01). "Main() / Entry Points (C# Programming Guide) - Microsoft Developer Network". docs.microsoft.com. Archived from the original on 2020-11-11. Retrieved 2018-12-03.

© MMXXIII Rich X Search. We shall prevail. All rights reserved. Rich X Search