I accidentally clicked something within the CodeBlocks environment and now when I run the C file one of my empty char arrays become populated with several garbage values. I redownloaded CodeBlocks, verified PATH and restarted my computer to no avail. Although I transferred my .c file to my laptop and everything worked correctly there my environment on my desktop still produces this behavior. Results of file run
The "X->" is the garbage value that appeared on this run but they vary every run.
Edit: The program isn't finished yet because of the error. Also, This is for my intro to C class and my code is probably terribly inefficient. Edit2: Upon running my file I hear the windows error sound.
int playRound(char starword[], char answer[])
{
int strikeTotal = 0;
int size = strlen(answer);
char userGuesses[27];
char userguess;
int correctInput = 0;
int counter = 0;
int starsInWord = strlen(starword);
int winCon = 0;
printf("Welcome to the round!\n");
printf("The size of the word has %d letters.\n",size);
while(strikeTotal <= 6)
{
printf("You currently have %d strike(s).\n",strikeTotal);
printf("Letter(s) you have guessed: %s\n\n",userGuesses);
printf("%s \n", starword);
correctInput = 0;
while(correctInput == 0)
{
printf("Enter your guess: ");
scanf(" %c", &userguess);
if ((userguess>= 65)&&(userguess<= 90))
{
userguess = userguess + 32;
correctInput++;
}
else if((userguess >= 97) && (userguess <= 122))
{
correctInput++;
}
else
{
printf("Invalid Input!\n");
}
}
userGuesses[counter] = userguess;
counter++;
printf("\nYou currently have %d strike(s).\n",strikeTotal);
printf("Letter(s) you have guessed: %s \n", userGuesses);
}