Blueprint array add works quite different than C++

C++ and blueprint arrays of actor references work the same way. they both store pointers to actors that are spawned into the world.
if you want to reference an actor, it has to be spawned into the world and exist for the entire time you need to use that pointer. if you want to save memory, and you don’t need to see the actor, you could instead store an array of structs that contain enough data to spawn the actor when you actually need it to exist.

i don’t recognize the syntax in your c++ example.
why do you have an asterisk after someitem*? are you trying to dereference a pointer? because if you want to dereference a pointer, the asterisk should be before *someitem, but dereferencing a pointer would give you the literal value it pointed to, which doesn’t make sense to add to an array of pointers, because its not a pointer. i would be surprised if that code compiles at all, since i have never seen an asterisk after a class without being followed by a name, and it takes 2 parameters to be considered multiplication, so it looks like gibberish to me.
is it a typo maybe?

is this what you meant?:

TArray<AItem*> myInventory;

FActorSpawnParameters SpawnInfo;
AItem* someItem = GetWorld()->SpawnActor<AItem>( GetClass(), SpawnInfo );
someItem->Ammo = 20;
myInventory.Add(someItem);

if ( myInventory[0] )
{
    myInventory[0]->Ammo--;
}