there's a structure of arrays like this.
char mother ;
char father ;
family divorce ;
Use isdigit() to determine whether the character is a decimal digit or not. If the char is a digit, populate it in the array.
Another way, check
if(ch >= '0' && ch <= '9') arr[i++] = ch;