My GetBullsCows function (right after making it use a struct) now has an error saying it is incompatible with its declaration in the header file. What I have and what was on the screen look identical, but I might just be dumb.
Here is the error:
{
"resource": "/i:/Unreal Projects/BullCowGame_starter_kit/Source/BullCowGame/BullCowCartridge.cpp",
"owner": "C/C++",
"severity": 8,
"message": "declaration is incompatible with \"<error-type> UBullCowCartridge::GetBullsCows(const FString &Guess) const\" (declared at line 22 of \"I:\\Unreal Projects\\BullCowGame_starter_kit\\Source\\BullCowGame\\BullCowCartridge.h\")",
"startLineNumber": 121,
"startColumn": 34,
"endLineNumber": 121,
"endColumn": 46
}
Here is the function:
FBullCowCount UBullCowCartridge::GetBullsCows(const FString& Guess) const
{
FBullCowCount Count;
for (int32 GuessIndex = 0; GuessIndex < Guess.Len(); GuessIndex++)
{
if (Guess[GuessIndex] == HiddenWord[GuessIndex])
{
Count.Bulls++;
continue;
}
for (int32 HiddenWordIndex = 0; HiddenWordIndex < HiddenWord.Len(); HiddenWordIndex++)
{
if (HiddenWord[HiddenWordIndex] == Guess[GuessIndex])
{
Count.Cows++;
break;
}
}
}
return Count;
}
And here is the declaration in the header:
FBullCowCount GetBullsCows(const FString& Guess) const;
Thanks for any help!