Click here to Skip to main content
15,897,518 members
Home / Discussions / C#
   

C#

 
QuestionRe: array help please Pin
harold aptroot5-Nov-09 10:56
harold aptroot5-Nov-09 10:56 
AnswerRe: array help please Pin
BDJones5-Nov-09 11:03
BDJones5-Nov-09 11:03 
GeneralRe: array help please Pin
harold aptroot5-Nov-09 11:29
harold aptroot5-Nov-09 11:29 
GeneralRe: array help please Pin
BDJones5-Nov-09 11:44
BDJones5-Nov-09 11:44 
GeneralRe: array help please Pin
harold aptroot5-Nov-09 11:50
harold aptroot5-Nov-09 11:50 
GeneralRe: array help please Pin
BDJones5-Nov-09 12:02
BDJones5-Nov-09 12:02 
GeneralRe: array help please Pin
harold aptroot5-Nov-09 12:03
harold aptroot5-Nov-09 12:03 
AnswerRe: array help please Pin
Christian Graus5-Nov-09 11:00
protectorChristian Graus5-Nov-09 11:00 
int[,] gives you a two dimensional list, not a list of pairs of numbers.

int[3,3] gives you a grid of 9 values, all of them a single int. To store pairs you'd need to define a struct, or you could use a map if you wanted ( which pairs values and lets you look up one value based on the other instead of an index ). I suspect that you're just experimenting, b/c I can't see any use for your final example ( the second value is always the same as the array index, so you have access to that number all the time anyhow ). Imagine I had a tic tac toe board for a game:

   |    |
___________
   |    |
___________
   |    |

Now - I can create a grid that's 3x3 with List[3,3] and I can use co-ordinates to look up positions in that list and track the game positions. That's the sort of thing a 2D array is used for.

Christian Graus

Driven to the arms of OSX by Vista.

Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

GeneralRe: array help please Pin
BDJones5-Nov-09 11:12
BDJones5-Nov-09 11:12 
GeneralRe: array help please Pin
Christian Graus5-Nov-09 11:55
protectorChristian Graus5-Nov-09 11:55 
Questiondatalist with an embedded dropdownlist. Pin
Crapaw455-Nov-09 10:31
Crapaw455-Nov-09 10:31 
AnswerRe: datalist with an embedded dropdownlist. Pin
Abhishek Sur5-Nov-09 10:42
professionalAbhishek Sur5-Nov-09 10:42 
GeneralRe: datalist with an embedded dropdownlist. Pin
Crapaw455-Nov-09 10:47
Crapaw455-Nov-09 10:47 
GeneralRe: datalist with an embedded dropdownlist. Pin
Abhishek Sur5-Nov-09 22:07
professionalAbhishek Sur5-Nov-09 22:07 
GeneralRe: datalist with an embedded dropdownlist. [solved] Pin
Crapaw456-Nov-09 3:17
Crapaw456-Nov-09 3:17 
GeneralRe: datalist with an embedded dropdownlist. Pin
Abhishek Sur8-Nov-09 4:29
professionalAbhishek Sur8-Nov-09 4:29 
QuestionRead TEXT from within 2 xml nodes (tricky I think ...) Pin
sodevrom5-Nov-09 9:58
sodevrom5-Nov-09 9:58 
AnswerRe: Read TEXT from within 2 xml nodes (tricky I think ...) Pin
Christian Graus5-Nov-09 10:32
protectorChristian Graus5-Nov-09 10:32 
Questionbase class connection string Pin
Stryder_15-Nov-09 9:25
Stryder_15-Nov-09 9:25 
AnswerRe: base class connection string Pin
PIEBALDconsult5-Nov-09 9:40
mvePIEBALDconsult5-Nov-09 9:40 
GeneralRe: base class connection string Pin
Stryder_15-Nov-09 10:20
Stryder_15-Nov-09 10:20 
GeneralRe: base class connection string Pin
PIEBALDconsult5-Nov-09 12:10
mvePIEBALDconsult5-Nov-09 12:10 
AnswerRe: base class connection string Pin
Not Active5-Nov-09 10:13
mentorNot Active5-Nov-09 10:13 
Questionicons changind while clicking treeview nodes Pin
Chesnokov Yuriy5-Nov-09 8:30
professionalChesnokov Yuriy5-Nov-09 8:30 
AnswerRe: icons changind while clicking treeview nodes Pin
snorkie5-Nov-09 9:27
professionalsnorkie5-Nov-09 9:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.