Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 11th, 2004, 05:47 AM
Registered User
Join Date: Aug 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Main Method

Could someone please explain why the main method is sometimes written

static void Main(string[] args)

what does the string[] args mean,

because it dosen't always have to be written.


Old August 11th, 2004, 06:51 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma

This array carries the command line arguments that you or OS passes to your application.
Try running your programs from command line and write something random after your application name.
Like this

C:\myapp.exe CodeMonkeys

Now in you main show the value of array for the valid nodes and you will come to know the significance of args.

Ankur Verma

Similar Threads
Thread Thread Starter Forum Replies Last Post
sub main missing. arygullo VB.NET 1 June 19th, 2007 09:38 AM
Instance of same class in main method ajit Java Basics 1 July 1st, 2006 06:26 PM
C++ and main for a beginner fords4me78 C++ Programming 2 February 27th, 2006 09:32 PM
Help with Main Menu GAF General .NET 0 March 18th, 2005 08:10 PM
To Imar: Re: Sub Main shadowpug VB.NET 2002/2003 Basics 1 July 26th, 2003 02:54 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.