C++ - Programming Language
This course covers the basics of programming in C++. Work your way through the videos and we'll teach you everything you need to know to start your programming journey!

2d Arrays & Nested Loops

Lesson 24
Author : Mike Dane
Last Updated : November, 2017


Code

Copy// int  numberGrid[2][3];
int numberGrid[2][3] = { {1, 2, 3}, {4, 5, 6} };

numberGrid[0][1] = 99;
cout << numberGrid[0][0] << endl;
cout << numberGrid[0][1] << endl;

for(int i = 0; i < 2; i++){
     for(int j = 0; j < 3; j++){
          cout << numberGrid[i][j] << endl;
     }
}