Trying to write a function that takes a letter from user input and checks it against an already existing array. I tried tweaking it and playing around with different things but it seems to only be able to hold value to a single element at a time so I would have to change the code every single time I want it to produce a new element. Any tips or help would really be great
int CompareGuess(char actualWord[SIZE], char*letterGuess, int num)
{
int i;
printf("Double checking game word is: %s\n", actualWord);
printf("Testing len: %d\n", num);
for (i=0; i<num; i++)
{
if (actualWord[i] == *letterGuess)
{
printf("Test the letter: %c\n", actualWord[i]);
printf("Testing 'i': %d\n", i);
return i;
}
else
{
printf("Test the letter: %c\n", actualWord[i]);
printf("Your guess of '%c' was no good\n",*letterGuess);
printf("Testing 'i': %d\n", i);
return -1;
}
}
}