#include <iostream>
using namespace std;
int main()
{
int points_a[3] = {1, 2, 3};
int points_b[3] = {4, 5, 6};
int points_c[3] = {7, 8, 9};
// Good Practice
int points[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
cout << points[1][2]; // 6
cout << points[2][0]; // 7
cout << points[2][2]; // 9
// Bad Practice
// int points[3][3] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
// cout << points[1][2]; // 6
// cout << points[2][0]; // 7
// cout << points[2][2]; // 9
return 0;
}
Comments