TArray and Static mesh help

So I stated a project today and ran into a problem. I need to select a random static mesh from a list of static meshes, so to do this I decided to make an array. Problem is that when I try to add something to this array I get errors and I cant figure out what I am doing wrong.
here is my code

TArray<UStaticMesh> Crates;
Crates.Add((TEXT("/Game/Meshes/Crate1.Crate1"));

I’m sure the problem is simple but I am stuck in this point in time.
Thanks in advance.

You are trying to add a string into an array which is expecting static meshes (UStaticMesh).

You will either need to load your mesh and then give it to the array, or save a list of strings which you could load later on.

TArray<FString> Crates;
Crates.Add("/Game/Meshes/Crate1.Crate1");

or

TArray<UStaticMesh> Crates;
UStaticMesh someMesh = LoadSomeMesh("/Game/Meshes/Crate1.Crate1");
Crates.Add(someMesh);

Sorry its mainly pseudo code. Basically, you are trying to put a string ("/Game/Meshes/Crate1.Crate1") into an array which is expecting a static mesh (UStaticMesh). You either need to change the storage type of the array () to something that allows a string ("") or you will have to load and create a UStaticMesh object and then put that into your array.

What is your end goal from this?

In code a UStaticMesh would look like:

UStaticMesh* myMesh;

This will need to be set at some point in your game to an actual mesh, such as a static mesh component from an actor perhaps?

myMesh = Cast(StaticMeshComponent);

Then you should be able to add that to your array

TArray<UStaticMesh> Crates;
Crates.Add(myMesh);

the first solution you gave has a red line under the . between Crates and Add that says, "No instance of overloaded function TArrayext matches the argument list.

And reguarding the second solution what is LoadSomeMesh used for?
Sorry if my question is simple, new to UE4

End goal is to create a simple game that will help me learn the engine.
So then what does a UStaticMesh look like then, i.e how is it referenced in code?

In the template I started in it creates them through a struct Crate1Mesh(TEXT("/Game/Meshes/Crate1.Crate1")) like so.
Why doesn’t it allow me to put this in the array?

Thank you heaps.
Fixed my problem. New code is as such

UStaticMesh* Crate1 = Cast<UStaticMesh>(StaticLoadObject(UStaticMesh::StaticClass(), NULL, TEXT("/Game/Meshes/Crate1.Crate1")));
	UStaticMesh* Crate2 = Cast<UStaticMesh>(StaticLoadObject(UStaticMesh::StaticClass(), NULL, TEXT("/Game/Meshes/Crate2.Crate2")));

	TArray<UStaticMesh*> Crates;
	Crates.Add(Crate1);
	Crates.Add(Crate2);