OOP in C++: Using the this Pointer & const Members
C++ 20
| Intermediate
- 10 Videos | 1h 5m 28s
- 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
-
1.Course Overview2m 1sUP NEXT
-
2.Using the this Pointer9m 29s
-
3.Chaining Method Invocations Using the this Pointer9m 59s
-
4.Creating const Objects and const Member Functions8m 34s
-
5.Identifying Common const Method Errors5m 47s
-
6.Using const Pointers and References5m 54s
-
7.Overloading Functions as const and Non-const6m 38s
-
8.Returning const and Non-const Values from Functions5m 37s
-
9.Using the const_cast and mutable Keywords8m 45s
-
10.Course Summary2m 45s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion of this course, which can be shared on any social network or business platform
Digital badges are yours to keep, forever.