Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

This forum is now READ-ONLY! Please visit http://forum.wiring.co/ for the new forum.

Wiring ForumProgramming Questions & HelpSyntax › multidimensional array

Page Index Toggle Pages: 1
multidimensional array (Read 2996 times)
02/18/07 at 21:56:27

stephanschulz   Offline
YaBB Newbies
Berlin, Halifax, Montreal

Posts: 14
*
 
A short example for multidimensional array.

1D array:
int my_list [] = {0,1,2,3};

2D array:
max_in_list = 4; // max amount of items in one list

int my_list [][max_in_list] = {
{0,1,2,3} ,
{4,5,6,7} ,
{8,9,10,11}
};

3D array:
//I think that's how a 3D array looks like. But have not tested it. ???

int my_list2 [][9][3] = {
{ {0,1,2} , {2,1,0}, {1,0,2} } ,
{ {3,4,5} , {5,4,3}, {4,3,5} } ,
{ {6,7,8} , {8,7,6}, {8,6,7} }
};
 
IP Logged
 
Page Index Toggle Pages: 1