Creating an pointer reference

Is there a difference between

AActor *HitActor = HitResult.GetActor();

and

AActor* HitActor = HitResult.GetActor();

Is there an easy way to remember where to put the pointer star?

No, there is no difference those two are the same including

AActor * HitActor = HitResult.GetActor();

What matters is whether it’s on a declaration or an expression.

*Thing; // unary *, dereference `Thing`
Type* Thing; // Thing is a pointer to Type

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms