Puzzle Game 2D Array

I am making a puzzle game with a 5x5 grid of blocks. In the code for the Puzzle program c++ blueprint you will find this piece of code in your (PuzzleFileName)BlockGrid.cpp

void AMyProject2BlockGrid::BeginPlay()
{
	Super::BeginPlay();

	// Number of blocks
	const int32 NumBlocks = Size * Size;

	// Loop to spawn each block
	for(int32 BlockIndex=0; BlockIndex<NumBlocks; BlockIndex++)
	{
		const float XOffset = (BlockIndex/Size) * BlockSpacing; // Divide by dimension
		const float YOffset = (BlockIndex%Size) * BlockSpacing; // Modulo gives remainder

		// Make postion vector, offset from Grid location
		const FVector BlockLocation = FVector(XOffset, YOffset, 0.f) + GetActorLocation();

		// Spawn a block
		AMyProject2Block* NewBlock = GetWorld()->SpawnActor<AMyProject2Block>(BlockLocation, FRotator(0,0,0));

		// Tell the block about its owner
		if(NewBlock != NULL)
		{
			NewBlock->OwningGrid = this;
		}
	}
}

I want to create a 2D array to hold the addresses to the puzzle blocks so I can manipulate those puzzle blocks later. Say if I click one puzzle block to change its color, the colors of the blocks above, below, left and right will change colors as well.

My guess is to initialize a 2D array of 49 elements.

AMyProject2Block BlockArray[7][7];

There are a total of 25 blocks on the board, but for use in my logic I will be initializing every block to NULL as default and only initializing the inner 25 blocks in the 2D array to NewBlock
This would be useful when determining which blocks to change colors with respect to the block I clicked on.

So if I clicked on the NewBlock in the bottom left hand corner it would change the block above and to the right because the blocks to the left and bottom are NULL.
The problem is that I don’t know if this is the correct way to go about this, so I need help.