Not exactly. You can use it as the buffer for a stringstream and try to extract into an int or double, depending on what exactly you're trying to do, and see if you get an error on that stream. Or, more straightforward, you can go to
and get lexical cast, which basically does what I described above, but in a more transparent way.
You can, of course, use isdigit() on each individual character of the string, although I'm sure the isdigit() for the C++ locales library is preferred.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.