Solved

C# array

Posted on 2007-03-17
2
174 Views
Last Modified: 2013-12-17
Please advise how to fix the below array assignment in C# :

    public string[] Roles = new string["Catcher",
        "Pitcher", "First Base", "Second Base", "Third Base",
        "Short Stop", "Left Field", "Center Field", "Right Field"];
0
Comment
Question by:ksfok
2 Comments
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 350 total points
ID: 18742355
Hi ksfok;

Here you go.

        public string[] Roles = {"Catcher",
                "Pitcher", "First Base", "Second Base", "Third Base",
                "Short Stop", "Left Field", "Center Field", "Right Field"};

Fernando
0
 
LVL 29

Assisted Solution

by:Gautham Janardhan
Gautham Janardhan earned 150 total points
ID: 18742669
or u can assign

like
 public string[] Roles = new string [9];
and then assign values

Roles[0] = "Catcher"; and so on
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now