Saturday, May 22, 2010

How to make C++ with a for loop and a 2d array?

Does anyone have the source code behind doing something like that i am wondering how to do it and if i can see a code to help myself learn it that would help alot thx. im using microsoft visual studios 2005

How to make C++ with a for loop and a 2d array?
Use nested loops.





for(int i = 0; i %26lt; numRows; i++){


for(int j = 0; j %26lt; numColumns; j++){


do something to array[i][j];


}


}





This will access every element in the array going from top to bottom and then left to right.


No comments:

Post a Comment