Can anyone tell me how to create the following program as a multi-dimensional array in C #. I think I started with something Like: But how do I create each entry? The numbers in single quote (1, 3g, 3g etc.) and numbers (i.e. 136, 1037 etc.) are also hostile I have assumed that something like this will be But this is clearly not correct. This is my first look in multi-dimensional arrays.
string [,] myBeaconArray = new string [numberOfBeacons, 1];
myBeaconArray [positionNumber, "beacon: '" + 1 variable 1 +', interaction: "+ variable2] ;
This is not a multi-dimensional array, at least not your example try this:
public square root objects {public string beacons {get; set;} {Intake public int interaction; Set; }}
To create a list, use it:
list & lt; Root object & gt; MyBeaconArray = New List & amp; Lt; RootObject & gt; () {New root object {beacon = "1", interaction = 136}, new root object {beacon = "3G", interaction = 1037}};
To create a fixed length array, use it:
var myBeaconArray = new root object [] {new root object {beacon = "1" ", Interaction = 136}, new root object {beacon =" 3G ", interaction = 1037}};
If you do not need to pass the object around, then you can use the unknown object like this:
var myBeaconArray = New [] {new {beacon = "1", interaction = 136}, new {beacon = "3G", interaction = 1037}};
No comments:
Post a Comment