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
-
how to select multiple files at a time using Ctrl+select and upload the attachments in C# .Net 1.0?
by vasanta (0 replies)
-
Help please for student
by mandy130 (0 replies)
-
Loop help needed
by BKRoberts (5 replies)
-
Problem after strong naming an assembly
by rinkurathor1 (0 replies)
-
Regarding User control creation in C# .Net(Windows Application)
by porchelvi (0 replies)
Related podcasts
-
Looking into the C# Crystal Ball with Charlie Calvert and Bill Wagner
One of the most exciting announcements from PDC was the news about C# 4.0 and Visual Studio 2010. With all the excitement and discussion throughout the event about these new developer tools, we reached out to two experts in the fields. Charlie Calvert and Bill Wagner sat down with Keith and Woody...
Events coming up
-
Dec
6
Developing AJAX Web Applications with Castle Monorail
London, United Kingdom
Monorail is the model-view-controller engine of the Castle Project, bringing many of the best ideas of Ruby on Rails to the .NET world. In this talk, David De Florinier and Gojko Adzic show how Monorail makes it easy to develop .NET based AJAX applications, and how to use the Castle Project to build Web 2.0 applications effectively. Come to this session if you are a .NET web developer. Everyone is welcome!
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# .