Get Actors in Level into C++

there are some the Actors in Level

I want to get the Actors in C++ Class BeginPlay

How can I get them.

I want to Push Class’s TArray

Here is Example

Class A : public Actor
{
TArray<Actor> m_tArray[ ? ]; //Can I dynamic Assign m_tArray as Level's the Actor ?
}


void BeginPlay()
{
m_tArray.push(Level's Actor); //What is function Push Actor to Array
}

Hello, you can use the GetAllActorsOfClass located in UGamePlayStatics. However with this method you won’t be needing the push function.

For example:

TArray<AActor*> AllActors;
 UGameplayStatics::GetAllActorsOfClass(GetWorld(),AActor::StaticClass(),AllActors);