OOP in C++: Using the this Pointer & const Members
C++
| Intermediate
- 10 videos | 1h 5m 28s
- Includes Assessment
- Earns a Badge
When a member function is invoked on a particular object, that object is known as the receiver. Within the body of the member function, you can access the member variables of the receiver using the "this" pointer. In this course, discover how the this pointer works and practice using it to access states. Next, learn about constness in object-oriented programming and the restrictions for what such methods can do. Finally, learn how to use the mutable keyword to mitigate constness. After completion of the course, you'll be able to access member variables from within member functions, create const and non-const objects and functions, and use the mutable specification to identify states that can be changed without changing the meaning of the object.
WHAT YOU WILL LEARN
-
Discover the key concepts covered in this courseUse the this pointerChain method calls by returning the this pointerCreate const objects and const member functionsIdentify common errors related to const objects and functions
-
Use const pointers and const referencesCreate const and non-const objects and functionsModify returned values of functions to modify the stateCreate setters, disable const using const_cast, and use mutable keywordsSummarize the key concepts covered in this course
IN THIS COURSE
-
2m 1s
-
9m 29s
-
9m 59s
-
8m 34s
-
5m 47s
-
5m 54s
-
6m 38s
-
5m 37s
-
8m 45s
-
2m 45s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.
Digital badges are yours to keep, forever.