Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 29,182 times

Contents

Related Categories

Program Entry point in C# - Introduction

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) {...}


Note
TheString and string words can be used interchangably; string is simply an alias of the String object.

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.

I am 22 male. BS(Computer Science), MCSE, Brainbench certifed. Member of .NET Open source, Mono Project. E-author on various websites, including www.dotnetextreme.com, www.csharphelp.com and so on. Currently working as a asst. network engineer, and as a freelance programmer, programming in Microsoft.NET platform. Love to use linux box with my NT-Machine.

Comments

  • Entry Point

    Posted by chinnu704 on 06 Jan 2003

    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!