[BullCowGame] FString variable from FStringArray in a .h file [Solved]

I’m assuming I’m not giving my Words variable the FString properly.
Can anyone help me figure it out !?

I’ve created a File named HiddenWordList.h with the Isograms I want in the game. This file is under the Source directory (like the cartridge files).

I cannot compile my code after adding this line:
HiddenWord = Words[FMath::RandRange(0, Words.Num()-1)];

//Last line on the second image
which should return a random Isogram from my list.

I show below the error log and snippets of my code (since I’ve done things slightly different from the lessons)

Crash LOGS:

BullCowCartridge.cpp code:

BullCowCartridge.h

HiddenWordList.h
WordList

Answered on Udemy.

1 Like

Should I remove this topic?

In the future just post the solution and mark as solved.

Solution:

Remove the Words member variable which is empty and was shadowing the global one.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms