There are 2 options:
The easiest would be to make it so that the number comes first, and then the name. Have it
cin the first part into an integer, then just cin again to get the rest of the input into a string.
If the number must come last, then simply read the entire line, then write a parsing function which copies everything into a new string until it reaches a number, then copy everything including and after that point into a new string (then copy it into an integer usint atoi() if you want).
I don't think there's any pre-written function to do this. scanf() could get close, but it usually uses space to split up words, so if the name was more than one word, it would have problems.