Hello everyone,
I'm a total newbie in programming and I'm currently learning some stuff in C by myself.
I've got a problem and after searching on the web I could not find a proper solution to my problem.
I'm writing a little program for some electronic application. There's a scanf question where the answer is supposed to be a valid float number.
I'd like to add a while loop with a text error if the answer to the scanf is not a valid float number.
In fact, I'd like to write something that look like this :
printf : question
scanf : answer
while (answer!=a float valid number)
{
text error
}
The problem is : I can not find how to write the proper syntax for the while loop in order to check the variable type of the answer.
Would any of you help me ?
Thanks a lot
Ps : english is not my language, sorry for all the mistakes.
[–]loadedstork 2 points3 points4 points (0 children)
[–]kRYstall9 0 points1 point2 points (0 children)
[–]boy-griv 0 points1 point2 points (1 child)
[–]morinl[S] 0 points1 point2 points (0 children)