Pointers and what I have come to understand

  1. When a variable is declared, the memory needed to store its value is assigned a specific location in memory (its memory address).

  2. The address of a variable can be obtained by preceding the name of a variable with a ampersand sign (&), known as address-of operator.

  3. A variable which stores the address of another variable is a called a pointer. The dereference operator (*) is “value pointed to by”.

  4. Due to the ability of a pointer to directly refer to the value that it points to, a pointer has different properties. Once dereferenced, the type needs to be known. And for that, the declaration of a pointer needs to include the data type the pointer is going to point to. Once dereferenced, the type needs to be known. And for that, the declaration of a pointer needs to include the data type the pointer is going to point to.

All this was cited from cplusplus(dot)com

Before anyone says that I didn’t do my due diligence. I want to point out that I read the entire article about pointers at cplusplus(dot)com and had to stop a arrays since they were not covered in the video lesson.

When declaring a pointer you first have the type.

Default standard:
type * name

UE4 standard:
FType* name

In the section on the video lesson about “The -> Access Operator” I was left confused and could use some clarification. Ben says, “When you put the star on the left of SomeActor; on it’s own, “de-references” the pointer. That means it goes to the memory address pointed to by SomeActor”. Yet according to cplusplus.com article when you de-reference a pointer you are pointing to the value stored at the address not the address itself. If you use the ampersand (&) / address-of operator, that is when you get the address of the point and not the value stored at the address.

I’m still at loss as to how to use and work with The -> Access Operator. But so far this is my understand of pointers using the suggested reference given by the instructor.

Privacy & Terms