The problem I have is that I have to fill a matrix and that during the filling process if I typed the 'd' key, I could delete some number of the ones entered or if 'l' could delete them all. I've tried with kbhit () and getch () but when entering a letter it does not let me re-enter numbers. I attach a small example of what I want to do.
int main(){
int x;
char tecla;
do{
if (kbhit()) {
tecla = getch();
} else {
tecla = ' ';
}
if(tecla!=' '){
if(tecla=='l'){
cout<<"ele"<<endl;
}else if(tecla=='v'){
cout<<"uve"<<endl;
}else if(tecla=='d'){
cout<<"de"<<endl;
}else{
cin>>x;
cout<<x<<endl;
}
}
}while(true);
return 0;
}