How do i check if a result is of the right type(int, float, double, etc.) and then throw and catch an exception in case it’s not?
Thanks all,
Vlad.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Could you give more detail about what is giving you “a result” you may be able to determine what you need from there and more likely in a better way.
If all you really want is to check the type, use
typeid.More info here
Following Daniel’s model of editing posts to actually answer the question after stating something else…
From my other comment: