5
float input;
cin>>input; // if the user type string in input then throw exception
if(!isdigit(input)){
throw "error";
}
Ma isdigit genera anche un'eccezione per un valore numerico.come si genera un'eccezione quando l'utente memorizza la stringa nella variabile float?
Come risolvere?
questo genera sempre eccezione anche se si digita un valore numerico. – shah
scusa c'è stato un errore nel mio codice. ha funzionato. Grazie – shah