Technical question about C++ pointers

Over the last few months I have learned quite a bit about C++ and C# in Unreal and Unity, however like many noobs I have a question about pointers. What I have learned so far is that the reason they are used is so that you are not copying large amounts of data into functions. And also the reason variables like ints, bools and rotators are not declared as pointers is because they take up about the same amount of memory. But my question is, if you are in the same class you need a reference to, is the reason that you don’t need to create a pointer to it because you’re already in that class’s C++ file? I guess I’m just looking for a technical explanation as to why that’s so, or if someone could “point” me in the right direction. Does the class itself and all its functions already live in the same block of memory? Thanks for any help.

I am learning C++ myself and assuming that you mean the class definition when you say “you are in the same class you need a reference to”, understanding the “this” pointer and how memory allocation happens in C++ should hopefully answer your question.

Here are a few links to help you out:

http://www.cyberplusindia.com/blog/index.php/2014/04/24/memory-organisation-of-objects-in-c/

In general pointers are most often used for Objects, i could not give you all the technical reasons, but this question does have an answer far better that i could give you: