Can anyone tell me how to test input for a datatype?
I want to be able to read input into a float variable but also to identify if the user input is not compatible with a float before the program throws out an error and dies.
If I read into a char * then I can't convert the input to a float value for mathematical operations so I was wondering if there are any validation functions that can be used.
Also, my Compiler does not accept void * variables as I have already tried this approach.
I want to be able to read input into a float variable but also to identify if the user input is not compatible with a float before the program throws out an error and dies.
If I read into a char * then I can't convert the input to a float value for mathematical operations so I was wondering if there are any validation functions that can be used.
Also, my Compiler does not accept void * variables as I have already tried this approach.