How can i convert a array to a structure

Hello everybody there is a node in unreal engine blueprint :

Ekran görüntüsü 2023-01-03 185831
how can i convert a array into struct in c++ for adding in a TMap?

I specifically want to do this in c++

Ekran görüntüsü 2023-01-03 190357

Hi @Kaan_Altay

“conver array into struct …” I think this would be more accurate:

I have made a little example with Skill Structs that are saved inside of 2 TArrays and these are stored inside a TMap.

Code

struct Skill
{
	FString Name;
	int Level;
};

void ULibTools::test1(int i)
{
	UE_LOG(LogClass, Log, TEXT("test1-------------------"));


	TArray<Skill> SkillArray;

	Skill s1 = Skill();
	s1.Name = TEXT("Trunk");
	s1.Level = 2;
	SkillArray.Add(s1);

	Skill s2 = Skill();
	s2.Name = TEXT("Tank");
	s2.Level = 3;
	SkillArray.Add(s2);

	TMap<FString, TArray<Skill>> Root;

	Root.Add("Driving", SkillArray);

	TArray<Skill> SkillArray2;
	Skill s3 = Skill();
	s3.Name = TEXT("Eggs Fried");
	s3.Level = 3;
	SkillArray2.Add(s3);

	Skill s4 = Skill();
	s4.Name = TEXT("Pasta");
	s4.Level = 1;
	SkillArray2.Add(s4);

	Root.Add("Cooking", SkillArray2);

	for (auto& Category: Root)
	{
		UE_LOG(LogClass, Log, TEXT("Category: %s"), *Category.Key);
		for(auto& Skill: Category.Value){
			UE_LOG(LogClass, Log, TEXT("  %s, %i"), *Skill.Name, Skill.Level);
		}
	}
}

Output:

LogClass: Category: Driving
LogClass: Trunk, 2
LogClass: Tank, 3
LogClass: Category: Cooking
LogClass: Eggs Fried, 3
LogClass: Pasta, 1

would be this what you want? your Skills are already struct or anything else?

I don’t think that is what i’m looking for. Thanks anyway.