jeudi 21 octobre 2021

how can i use (!(cin>>a)) twice times?

enter image description here i have used code ( if (!(cin >> arr[i])) ) to check if input from user is different with type int (like string, char) to stop reading into array (arr1), and then i can't use it twice with the second array (arr2), it didn't read input and go straight to cin.clear and return... Can you help me? Thank you very much from it^^ enter image description here

Aucun commentaire:

Enregistrer un commentaire