Hey everyone,
Just wondering, does C++ have a way of checking whether data entered is a number? I know Flash has some cool features for interpreting the data entered, but I am wondering if something similar exists in C++.
I am trying to create a portion of a larger program that displays an error when the user enters data that is not an error.
*Originally posted by Jubba *
**if its not a number it won’t run… **
im not too sure if this is right…i remember when i was learning c++ last year with basic win32 programs, if the wrong data was entered say a character where a number was supposed to be entered, the program would just go nuts and infinite loop over and over…now maybe that was my programming skills and maybe it is different if you are making it with MFC…:-\
well, unlike actionscript, c++ uses typed variables. so you cant read anything else then a number into an integer. you just cant do it. so a check is really redundant, as that can never happen.
c++ would probably error if data entered won’t be the type it expects it to be, im not sure how it would act in such case.