i am working on XO game with c++ but i have a problem
cout<<"please enter the field number For O"<<endl;
cin.get(a);
if (a=='1')
arr[0][0] = 'O';
else if (a=='2')
arr[0][1] = 'O';
else if (a=='3')
arr[0][2] = 'O';
else if (a=='4')
arr[0][3] = 'O';
else if (a=='5')
arr[0][4] = 'O';
else if (a=='6')
arr[1][0] = 'O';
the problem here is when i try to enter a number bigger then 9, for example 15, the program reads it 1 and 5 so it applies two conditions at once, i tried to use get
cin.get(a);
but it gave me the same result