Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String

Status
Not open for further replies.

mayu03

Programmer
Oct 3, 2003
91
US
it is any function for string simular to isdigit()?
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top