Making a simple mistake somewhere

Trying to build a 2D array highlighted in bold below. It works fine if I use something like [5][6] to specify the dimensions but if I use variables, then I get this error: a nonstatic member reference must be relative to a specific object

I’ve attached the full code below, this is in the header file.

class GAMEPROJECT7_API AMyActor : public AActor

	UPROPERTY(EditAnywhere, Category = "Switch Variables")
	int32 platformRows = 5;

UPROPERTY(VisibleAnywhere, Category = "Switch Variables")
	int32 platformCols = 6;


int getColSize(){
	return platformCols;

int getRowSize(){
	return platformRows;

**TSubclassOf<AActor> CubeClassTest[platformRows][platformCols];**

// Sets default values for this actor's properties

// Called when the game starts or when spawned
virtual void BeginPlay() override;

// Called every frame
virtual void Tick( float DeltaSeconds ) override;


You may be better using an array of structs in this case. Rama has written an excellent tutorial and code examples on the wiki: