It is legal but redundant to refer to members through the this pointer. Discuss the pros and cons of explicitly using the this pointer to access members
belongs to book: C++ Primer|Stanley B.Lippman, Josee Lajoie, Barbara E.Moo|5th Edition| Chapter number:7| Question number:30
All Answers
total answers (1)
Proc:
- It is much more clear by using
`this`
to refer members.- The parameters in member function can have the same name as the data members if we use
`this`
pointer to refer data members.Cons:
- The code will look redundant.