"this"

Am I correct in saying this? I'm still trying to wrap my head around "this" pointers... Thanks in advance!

"this" keyword is a type of pointer and when using "this" you need to use the arrow member selection operator to point to a function or variable within the class because "this" is a pointer and it stores as it's variable the address of the current object working with once the object is created.

(*this).A is called dereferencing a pointer, it's a pointer that takes the address of the current object working with once the object is created and calls whatever variable or function using the dot separator, explicitly calling a variable or function.

Calling a standard variable i.e cout << A << endl; in main or a class just assumes you are working with said variable in whatever location applicable.
*edit*
Last edited on
What is your question?
Here is example I asked about, might help:

ghttp://www.cplusplus.com/doc/tutorial/templates/
...Still waiting for a helpful response :L
ALEXCX2PLUS wrote:
Am I correct in saying this?

Yes
That's more like it, cheers man.
Topic archived. No new replies allowed.