In the following loop, if we type characters as the cin
input instead of numbers which are expected, then it goes into infinite loop. Could anyone please explai
Perhaps, it's because,
You can solve this problem like this: 1. Create a function to take in a string input. 2. return it as numeric after conversion. Use strtod() for conversion.
Hope this helps :)