Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 11th, 2004, 06:47 AM
Registered User
 
Join Date: Aug 2004
Location: , , Botswana.
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.

Thanks


CodeMonkeys
Reply With Quote
  #2 (permalink)  
Old August 11th, 2004, 07:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
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
Default

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.

Regards
Ankur Verma
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
sub main missing. arygullo VB.NET 1 June 19th, 2007 10:38 AM
Instance of same class in main method ajit Java Basics 1 July 1st, 2006 07: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 03:54 PM



All times are GMT -4. The time now is 04:09 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.