So my friend is trying to teach my how to program in C and I'm stumped. I'm a complete beginner and he gave me something to try and do with more advanced code than what I know and understand. For what I have to do with his code he told me that I need to exclude certain characters, specifically periods and commas from names, and only allow the numbers 1 or 2 to be put in at the end of a name. So for example Josh1 would be allowed, but Josh,2 wouln't be. Is there a way I can do this? I've inserted the code below and need the help.
This is just the piece of coding he told me that I'd need to edit, and I really appreciate the help if it can be given. I'm all out of ideas and so is he(I'm not sure if he's just lying that he doesn't know what to do, or if he's telling the truth that he doesn't).
//char arrays to hold playernames and int values for various things.
int main (void)
while (balloons != 0)
printf("There Are %d Balloons Left\n",balloons);
//SetUp Function That Sets base Peramators and gets the players names.
int SetupGame (void)
balloons = 10;
if (playonce == 0)
//Gets Players Names
printf("Welcome to Balloon pop\nFirst Player Enter Your Name:\n");
printf("Welcome to Balloon pop\nSecond Player Enter Your Name\n");
//Checks If The Names Are The Same.,
if (!(strcmp(player, player)))
check = 1;
while(check != 1);
playonce = 1;