Code:
void Character_Creation_Players(Player *player)
{
char* name;
char* race;
char input;
printf("=====================================================\n");
printf("================Character Creation===================\n");
printf("=====================================================\n\n");
printf("What will be the name of the hero brave enough to venture into the Forest of Darkness?\n");
scanf("%s", name);
printf("What Race is this %s?\n", name);
scanf("%s", race);
printf("%s", race);
printf("What class will this %s be? (1) = Warrior, (2) = Rogue, (3) = Wizard, (4) = Cleric\n", name);
scanf("%c", &input);
switch (input)
{
case '1': //Warrior
Init_Players(player, name, race, "Warrior", 1, 18, 0, 10, 11, 0, 120, 20, "Rusted Iron Axe", 3, 9, 5, 5);
break;
case '2': //Rogue
Init_Players(player, name, race, "Rogue", 1, 12, 8, 7, 14, 0, 120, 50, "Rusted Iron Daggers", 2, 11, 2, 5);
break;
case '3': //Wizard
Init_Players(player, name, race, "Wizard", 1, 10, 15, 6, 18, 0, 120, 20, "Basic Staff of Magic", 2, 6, 5, 5);
break;
case '4': //Cleric
Init_Players(player, name, race, "Cleric", 1, 12, 12, 7, 12, 0, 120, 20, "Magical Battle Staff", 2, 8, 5, 5);
break;
default: //Invalid Input
printf("Error 1:\nYou have entered an invalid selection\n");
return;
};
}
So the problem is that after I type the name of the race it won't let me enter the class selection number and goes straight to the default case in the switch statement.