Hi, I'm trying to write a function that would allow me to take a user's input and compare it against the letters from a file that is being scanned in. And if the letter matches one from the file, it would replace a character in a different array at a specific element. So far this is what I have:
1 2 3 4 5 6 7 8 9 10 11 12 13
int CompareGuess(char actualPtr[], char letterGuess, int num)
{
int i;
for (i=0; i<num; i++)
{
if (actualPtr[i] = letterGuess)
{
return i;
}
return -1;
}
}
I'm stuck after this point. Any help would be greatly appreciated