HI. I want to input the elements of a two dimensional array in the same line .
so while giving input . when i press enter . it should remain on the same line ?
HOW to do that ?
Thanks in advance.
#include <iostream>
usingnamespace std;
int main(){
constint X = 10, Y = 10;
// I've made the array hold char. Change it to whatever type you want.
char array_2d[X][Y];
for(int i = 0; i < Y; i++){
for(int j = 0; j < X; j++){
cout << "Enter value for position " << j << ", " << i << ": ";
cin >> array_2d[j][i];
}
}
return 0;
}