It all depends whether you're asking for a single digit or larger.
If it's a single digit then make guess a char and check whether guess isdigit()
See http://www.cplusplus.com/reference/cctype/isalpha/?kw=isalpha is gives you lot's of food to solve for more complicated scenarios.
<string> might have a similar functionality, I'm not sure what it is. In fact you could use strings and just run through each character that makes up the string to make sure each is a digit. :)