?
Solved

how do change the attach code snippet to become a 2 or 3 dimensioned variable array?

Posted on 2008-10-18
5
Medium Priority
?
219 Views
Last Modified: 2013-12-17
how do change the attach code snippet to become a 3 dimensioned variable array?

i.e.   string, bool  & int values per entry
private static string[] inputWords;
 
        public static string[] _inputWords
        {
            get { return inputWords; }
            set { inputWords = value; }
        }

Open in new window

0
Comment
Question by:amillyard
[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
  • 3
  • 2
5 Comments
 
LVL 16

Expert Comment

by:CuteBug
ID: 22749338
A three dimensional array can be declared the following way

private static string[,,] inputWords;

public static string[,,] _inputWords
{
     get { return inputWords; }
     set { inputWords = value; }
}

0
 

Author Comment

by:amillyard
ID: 22749354
CuteBug: thanks -- but I am not quite understanding the changes (..)

value
  [0] -- should contain a string, bool and int value
  [1] -- should contain a string, bool and int value etc....
0
 
LVL 16

Accepted Solution

by:
CuteBug earned 2000 total points
ID: 22749371
In that case you should define a array of a struct.


struct MyData
{
   string StringValue;
   bool BoolValue;
   int IntValue;
}
 
private static MyData[] inputData;
 
public static MyData[] _inputData
{
     get { return inputData; }
     set { inputData= value; }
}

Open in new window

0
 

Author Comment

by:amillyard
ID: 22749641
I am getting the following compile error


Error      1      Inconsistent accessibility: property type 'GlobalVars.MyData[]' is less accessible than property 'MENTOR_AI.GlobalVars._inputData
0
 

Author Comment

by:amillyard
ID: 22749888
it's ok -- I had a 'public' as follows:

public struct MyData

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

764 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