Hi all,
Simple C++ Q for you…
I’m defining a TArray of UStructs in my header file like this:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Data")
TArray<FStarMapDataLookupTable> OutAllRows; // TArray to hold the outputted rows -> of STRUCT type
Then in the .cpp file i’m trying to populate this array with data from my DataTable with:
StarMapLookupTable->GetAllRows<FStarMapDataLookupTable>(Context, OutAllRows);
I’m getting the following error whilst compiling:
'void UDataTable::GetAllRows<FStarMapDataLookupTable>(const FString &,TArray<FStarMapDataLookupTable *,FDefaultAllocator> &) const': cannot convert argument 2 from 'TArray<FStarMapDataLookupTable,FDefaultAllocator>' to 'TArray<FStarMapDataLookupTable *,FDefaultAllocator> &'
If I define the TArray within the .cpp file in the function it compiles fine. As I’ll be using this TArray in multiple functions i thought it would be best to define it in the .h file and populate it once in BeginPlay()
Any help greatly received… cheers, Matt.