Sometimes when English isn't your native language it is even more difficult to explain what you want to do than it is for us native English speakers. To use multidiminsional arrays you can do something like this:
int array[2][2];
which declares a variable on the stack with enough memory for 4 ints. Now to get the information into that array you can do several things. Here's one way:
for(int i = 0; i < 2; ++i)
{
for(int j = 0; j < 2; ++i)
{
cout <<"enter a value" << endl;
cin >> array[i][j];
}
}
and to dispay the values you use another nested loop except the body would be something like:
//pseudocode to display array as a table
for()
for()
cout << array[i][j] << ' ';
cout << endl;
Reputation Points: 718
Solved Threads: 373
Nearly a Posting Maven
Offline 2,253 posts
since Jul 2005