The code is glitching out when i'm trying to do a simple character exchange. The code is listed down below along with screen shots of the error.
#include <stdio.h>
int main()
{
char Ghost[12] = "SimonGhost";
int ghostdeathdate = 5;
char Price;
int Soap;
while (ghostdeathdate > 0)
{
scanf("%c %d", &Price, &Soap);
Ghost[Soap] = Price;
printf("%s\n", Ghost);
--ghostdeathdate;
}
return ghostdeathdate;
}