Library tutorials & articles
Program Entry point in C#
Introduction
This article will examine entry points in C# programs, and the possible errors you can come across. The function to
be called in any C# program is Main. We can have as many as four different ways
to declare Main in our program. They are as follows:static void Main() {...}
static int Main() {...}
static void Main(string[] a) {...}
static int Main(string[] args) {...}
|
|
The operating system calls Main and waits for it to return a value. This value
denotes the success or failure of the program.
Main can either return a number or result in no return value, that is, void.
If it returns an int, by convention, a value of zero means success and any other
value indicates an error. No international authority can standardize the error
numbers, it largely depends on the programmer himself.
Related articles
Related discussion
-
looking for help on asp
by cladironbeard (2 replies)
-
Socket Programming in C# - Part 1
by graumanoz (23 replies)
-
LINQ in Action
by naser1 (0 replies)
-
Creating a Windows Service in VB.NET
by Templario55 (107 replies)
-
simple vb to c#, help please
by lksath (1 replies)
Related podcasts
-
Object-Oriented Programming in Ruby
In this episode, I talk with Scott Bellware about object-oriented programming in Ruby, and Ruby's object model. This is taken from a private conversation, and the audio quality suffers at times. Much thanks to Scott for allowing this to be released.This episode of the Alt.NET Podcast is bro...
Events coming up
-
Aug
28
St. Louis Day of .NET
St. Charles, United States
Technical conference with be 2 full days of content with over 40 sessions from local and national speakers, with topics such as:•.NET languages: C#, VB.NET•Technologies: WPF, Silverlight, WCF•Development tools: Visual Studio, TFS, Expression Blend
I am not discouraging you, but I just dont see a need for an article on this issue. One can find out those errors on trial and error basis with a test program. Give us something new and creative!
This thread is for discussions of Program Entry point in C# .