I want to convert a string to an integer and validate that it is an actual integer. The following is what I have. An extra pair of eyes can help me locate a possible validation error I didn't check for or a way to accomplish the same tasks but in a better way. Err_Type is an enumeration of different types of errors. All ideas are appreciated. Just trying to better my understanding of c++.
I want to convert a string to an integer and check for all possible errors. The following is what I have. An extra pair of eyes can help me locate a possible error I didn't check for or a way to accomplish the same tasks but in a better way.
I am not clear what you are asking. What is the specific error are you encountering? Or are you asking for a code review?
No sorry, I meant I was wanting to check for all possible input errors. user enters a math problem (ex: "12+7*-32"). I parse this string into a vector of strings that alternate between numeric and operator. I need to check each numeric by attempting to convert them to integers. I am asking for a code review. I am basically trying to write the best function to validate and convert a string to an integer to be used for current and future projects. Learning through the advice of the general public :)