How to check a string for digits

I need to check a string and make sure it only has digits. I know how to check certain positions inside the string with (isdigit(str[0])) but is there a way to check the whole thing at once?
isdigit(str.c_str())?
isdigit() takes a char as argument, not a char*

I don't think that's possible
oh well i tried.
Topic archived. No new replies allowed.