Home > Topic List > The role of c++this pointer

The role of c++this pointer

The functions of this pointer are: 1. Access the member variables and member functions of the current object in the member function. The member function can access the member variables of the object through this pointer. When calling a member function of an object, the compiler automatically The address is passed to the this pointer, so that the this pointer can be used to access the member variables of the object in the member function; 2. Call other member functions in the member function. When a member function calls another member function, the compiler will automatically The address is passed to the this pointer of the called member function.

Related courses More >
ElementaryC++ manual tutorial

52628 times of learning

Collection
ElementaryIssue 9_Front-end Development

20062 times of learning

Collection
ElementaryThe seventh issue_TP6 basics and CMS practice

19266 times of learning

Collection
Related Tutorials More >