Sorry for taking so long but this is my new modified code because of the advice and warnings from all the above posters. The same rules apply: use strtok to remove everything but numbers from the form of (555) 555-5555
As originally stated if anything can be made better or if I am violating something such as undefined behavior and the like, then just let me know as I take all your inputs as valuable knowledge.
Code:
void separate(char *string1)
{
char stringSep[15];
char *token;
strcpy(stringSep, string1);
token = strtok(stringSep, "() -");
strcpy(string1, token);
while((token = strtok(NULL, "() -")) != NULL)
{
strcat(string1, token);
}
}