Got the above error when doing video 40. Also the debugger takes me to:
‘xstring’ line 2944 ‘_IDL_VERIFY(_Off <= this->_Mysize(), “string subscript out of range”);’
and says “Exception Thrown: BullCowGame.exe has triggered a breakpoint”
VS2017 then crashes when I try to use their tools to get more information.
I don’t receive my error messages.
What could be the problem.
FBullCowCount FBullCowGame::SubmitGuess(FString Guess)
{
// recieives a valid guess, increments turn and returns count.
MyCurrentTry++;
//setup a return variable.
FBullCowCount BullCowCount;
//loop through all letters in the guess.
int32 HiddenWordLength = MyHiddenWord.length();
//compare letters against the hidden word
for (int32 i/*MyHiddenWordChar*/ = 0; i < HiddenWordLength; i++)
{
for (int32 j/*GuessChar*/ = 0; j < HiddenWordLength; j++)
{
//if they match
if (Guess[j] == MyHiddenWord[i])
{
if (i == j)//if they are in the same place
{
BullCowCount.Bulls++; //increment bulls
}
else
{
BullCowCount.Cows++; //increment cows
}
}
}
}
return BullCowCount;
};