How to translate this blueprint to C++? [Arrays related]

Hi, to speed the progress I will post the image of the blueprint and the C++ code I am already trying
BP

Code

void ATestActor::PrintElements(EItemType& ItemType)
{
	TArray<EItemType> Arr{}; //UEnum type
	TArray<FName> OutRowNames{};

	if (const UDataTable* DT_ItemTypeProbability = LoadObject<UDataTable>(NULL, TEXT("/Game/DataTables/ItemsGeneration/DT_ItemTypeProbability")))
	{
		OutRowNames = DT_ItemTypeProbability->GetRowNames();
		for (auto& Array : OutRowNames)
		{
			if (const UDataTable* DT_ItemTypeProbability{ LoadObject<UDataTable>(GetWorld(), TEXT("/Game/DataTables/ItemsGeneration/DT_ItemTypeProbability")) })
			{
				if (const FST_ItemTypeProbability * OutRow{ DT_ItemTypeProbability->FindRow<FST_ItemTypeProbability>(FName(Array), "") })
				{
					if (OutRow)
					{
						TypeProbabilityDatas = *OutRow;
						for (int32 i = 1; i <= TypeProbabilityDatas.Percent; i++)
						{
							Arr.Add(TypeProbabilityDatas.Type);
						}
					}
				}
			}
		}

		for (auto& Array : Arr)
		{
			UE_LOG(LogTemp, Warning, TEXT("%c"), Array);
		}
		printf("_____________");
		ItemType = Arr[FMath::RandRange(0, 99)];
	}
}

Problem

unable to print the correct data from Array

Details

expected correct data from data table.

but printed the unreadable incorrect data.
testtransform17

Data Table: DT_ItemTypeProbability
image_2022-08-04_201937499

change %c to %d and let me know if you get printed only percent values

1 Like

yes now only random numbers printed :smiley:

now tried this but still not working.

		for (auto& Array : Arr) //Arr is UEnum type of array
		{
			FString GetNames = UKismetNodeHelperLibrary::GetEnumeratorUserFriendlyName(CastChecked<UEnum>(CastChecked<UDynamicClass>(ATestActor::StaticClass())->UsedAssets[2], ECastCheckedType::NullAllowed), static_cast<uint8>(Array));

UKismetSystemLibrary::PrintString(this, GetEnumNames_String, true, true, FLinearColor(0.000000, 0.660000, 1.000000, 1.000000), 2.000000);
		}

Solution