OOP in C++: Using the this Pointer & const Members

C++ 20    |    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 course
    use the this pointer
    chain method calls by returning the this pointer
    create const objects and const member functions
    identify common errors related to const objects and functions
  • use const pointers and const references
    create const and non-const objects and functions
    modify returned values of functions to modify the state
    create setters, disable const using const_cast, and use mutable keywords
    summarize the key concepts covered in this course

IN THIS COURSE

  • Playable
    1. 
    Course Overview
    2m 1s
    UP NEXT
  • Playable
    2. 
    Using the this Pointer
    9m 29s
  • Locked
    3. 
    Chaining Method Invocations Using the this Pointer
    9m 59s
  • Locked
    4. 
    Creating const Objects and const Member Functions
    8m 34s
  • Locked
    5. 
    Identifying Common const Method Errors
    5m 47s
  • Locked
    6. 
    Using const Pointers and References
    5m 54s
  • Locked
    7. 
    Overloading Functions as const and Non-const
    6m 38s
  • Locked
    8. 
    Returning const and Non-const Values from Functions
    5m 37s
  • Locked
    9. 
    Using the const_cast and mutable Keywords
    8m 45s
  • Locked
    10. 
    Course Summary
    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 of this course, which can be shared on any social network or business platform

Digital badges are yours to keep, forever.