Solved

C# array

Posted on 2007-03-17
2
178 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 63

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

737 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