Alternative to *ControlledTank->GetName()?

Hi,

When I wrote this I used *GetPawn()->GetName() instead of ControlledTank-GetName().

Are they functionally exactly the same for this? Do they both reference the same pawn? (I understand that ControlledTank would be better as it is more explicit but I am curious to understand if they are technically referencing different things:

They should both point to the same object.

They both are the same thing as if you remember that the methond GetControlledTank returns the pawn it controls type casted to ATank, and then you store it into the ControlledTank variable.

So, yes. Essentially they are the same thing.

Privacy & Terms