[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

C# array

Posted on 2007-03-17
2
Medium Priority
?
184 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 64

Accepted Solution

by:
Fernando Soto earned 1400 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 600 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

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

830 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