Creating an Array: Difference between revisions

(→‎[[C]]: Added syntax highlighting)
Line 123:
 
 
For Multi-Deminsional arrays you delcaredeclare them the same except for a comma in the type declaration.
 
The following creates a 3x2 int matrix
int[,] number_matrix = new int[3][,2];
 
As with the previous examples you can also initialize the values of the array, the only difference being each row in the matrix must be enclosed in its own braces.
Line 134:
or
 
string[,] funny_matrix = new string[2][,2]{ {"clowns", "are"} , {"not", "funny"} };
 
==[[ColdFusion]]==
Anonymous user