Reputation: 169
int main(void){
float f=0,ff=0;
if (scanf("%f %f",&f,&ff) == 2){
printf("True\n%f %f",f,ff);fflush(stdout);
} else{
printf("False\n%f %f",f,ff);fflush(stdout);
}
getchar();
return 0;
}
If my input is "6.81 7.kj" it returns true!!
Upvotes: 2
Views: 169
Reputation: 88711
7.
is a valid float. The fact that there's more input left is irrelevant to the success of the call.
Upvotes: 3