Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Entry point
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Point in a computer program where instruction-execution begins}} {{For|other uses of "Entry Point" and "Point of Entry"|Point of Entry (disambiguation)}} [[File:Program-entry-point-demonstration-CSharp.png|alt=Example of the main function, in C#.|right|thumb|467x467px|How the <syntaxhighlight lang="c#" inline>Main()</syntaxhighlight> might look in [[C Sharp (programming language)|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.{{not in source|date=April 2024}}<ref>{{Cite web|url=http://www.wisegeek.com/in-computing-what-is-an-entry-point.htm|title=In Computing, what is an Entry Point? (with picture)|website=wiseGEEK|language=en-US|access-date=2020-01-22|archive-date=2020-08-05|archive-url=https://web.archive.org/web/20200805091503/https://www.wisegeek.com/in-computing-what-is-an-entry-point.htm|url-status=live}}</ref> To start a program's [[execution (computing)|execution]], the [[Loader (computing)|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 (program lifecycle phase)|run time]]. For some operating systems and [[programming language]]s, 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.<ref>{{Cite book|url=https://books.google.com/books?id=NlR_m9OWgoYC&q=passing+the+control+to+the+entry+point&pg=PA349|title=Programming Environments for Massively Parallel Distributed Systems: Working Conference of the Ifip Wg 10.3, April 25-29, 1994|last1=Decker|first1=Karsten M.|last2=Rehmann|first2=RenΓ© M.|date=1994|publisher=Springer Science & Business Media|isbn=978-3-7643-5090-1|language=en}}</ref> In simple systems, execution begins at the first statement, which is common in [[interpreted language]]s, simple [[executable]] formats, and [[boot loader]]s. In other cases, the entry point is at some other known [[memory address]] which can be an [[absolute address]] or relative address ([[offset (computer science)|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|C-family languages]], this is a function called <code>main</code>; as a result, the entry point is often known as the '''main function'''.<ref>{{Cite web|url=https://www.geeksforgeeks.org/main-method-in-c-sharp/|title=Main Method in C#|date=2018-11-30|website=GeeksforGeeks|language=en-US|access-date=2020-01-22|archive-date=2020-07-31|archive-url=https://web.archive.org/web/20200731013439/https://www.geeksforgeeks.org/main-method-in-c-sharp/|url-status=live}}</ref> In [[JVM languages]], such as [[Java (programming language)|Java]], the entry point is a static method called <code>main</code>; in [[CLI languages]] such as C# the entry point is a static method named <code>Main</code>.<ref>{{Cite web|url=https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/main-and-command-args/|title=Main() / Entry Points (C# Programming Guide) - Microsoft Developer Network|last=Wagner|first=Bill|date=2017-08-01|website=docs.microsoft.com|language=en-us|access-date=2018-12-03|archive-date=2020-11-11|archive-url=https://web.archive.org/web/20201111180105/https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/main-and-command-args/|url-status=live}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)