Can someone help me to debug this problem in C++? I want it to loop if the user want to enter once again, but the error keeps on showing up.
void typeA(){
int j;
char dec;
do{
cout << "Enter Month: ";
cin >> month[j];
cout << "Enter Date: ";
cin >> date[j];
cout << "Enter Time in Hour: ";
cin >> aHours[j];
cout << "Enter Time in Minutes: ";
cin >> aMins[j];
cout << "Enter Time Out Hour: ";
cin >> aHours[j];
cout << "Enter Time Out Minutes: ";
cin >> aMins[j];
cout << "Enter Again?: [y/n]";
cin >> dec;
}while(!dec.compare('y'));
cout << "Exit";
}