input int into 2D array elements using for loops

In the following code, I am trying to input an integer into each element of a 2D array using a loop.

What happen is that the "y" value never changes from "0" and the "x" value never terminates, creating an infinite loop.
Can someone please give me a hint as to what I'm doing wrong?



#include <iostream>
using namespace std;


int arrTwo[5][3];
for (int x = 0; x < 5; x++) {
for (int y = 0; y < 3; x++) {

cout << "this is location " << x << "," << y << " in
arrTwo[5][3]" << endl;
cout << "enter an int into location" << endl;
cin >> arrTwo[x][y];
cout << "this is the input that was just typed for this location " << arrTwo[x][y] << endl << endl;
}
}
Did you mean the increment to be y++ in the inner for loop?

for (int y = 0; y < 3; x++) {
Topic archived. No new replies allowed.