Yes, you can use the isdigit() function to check for a digits :)
Here you go:
#include <iostream>
#include <cctype>
#include <string.h>
using namespace std;
int main(){
char *str = "(555) 555-5555";
int len = strlen(str);
for (int i=0; i<len; i++){
if (isdigit(*(str+i))){
cout << *(str+i);
}
}
cout << endl;
return 0;
}
Hope it helps :)