How to log the length of a struct array in string or integer?

I already showed the string in my code. And it does not matter, which contents the array has, I just used FString, could also be anything else)

So:

TArray<FMyStruct> myarray;
GEngine->AddOnScreenDebugMessage(-1, 4.0f, FColor::White, FString::Printf(TEXT("Struct Size: %d"), myarray.Num()));

And pure length number as string

GEngine->AddOnScreenDebugMessage(-1, 4.0f, FColor::White, FString::FromInt(myarray.Num()));

Added corrections, had just bad examples before…

1 Like