Validation for float in c++
i getting input as float. for example if the user is entering 3.5 then it works fine.  but if user is entering 3.X or any other characters its giving an infinite loop. is there any way in which i can validate the variable so that user can enter only numbers.I am using gcc compiler.
Validation for float in c++
===

i getting input as float. for example if the user is entering 3.5 then it works fine.  but if user is entering 3.X or any other characters its giving an infinite loop. is there any way in which i can validate the variable so that user can enter only numbers.I am using gcc compiler.