| biLmLik (27) | |
| guyz!!!!can u please guide me about that keyword "this" which is used with "->" that operator.what is meant by "this" with "->" in c++.................thnxs !!!! | |
|
Last edited on
|
|
| slider57 (46) | |||
The 'this' keyword references the name of the calling object. So if I wrote some code such as:
when i write code i generally use the 'this' pointer because it helps organize the function calls with their objects. the dot operator gets the objects information (functions or variables) but cant be used with 'this' because a reference (pointer) only points to an object but is not actually the object. so you need to dereference (go get the object in other words) it so it becomes the object. Summary: -> : is used as a way to dereference a pointer to get the object * : is used as a way to dereference a pointer to get the object . : is a way to access information on an object Another useful operator: & : gets the address of anything stored in memory Information can be accessed two ways: from the data type itself (.) or from the reference pointer (->, *) does that help? | |||
|
Last edited on
|
|||