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

C++    |    Intermediate
  • 10 videos | 1h 5m 28s
  • Includes Assessment
  • Earns a Badge
Rating 4.7 of 14 users Rating 4.7 of 14 users (14)
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

  • 2m 1s
  • 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 on some of our courses, which can be shared on any social network or business platform.

Digital badges are yours to keep, forever.

YOU MIGHT ALSO LIKE

Rating 3.9 of 20 users Rating 3.9 of 20 users (20)
Rating 4.3 of 131 users Rating 4.3 of 131 users (131)
Journey C++
Rating 5.0 of 2 users Rating 5.0 of 2 users (2)

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE

Rating 4.5 of 53 users Rating 4.5 of 53 users (53)
Rating 4.2 of 111 users Rating 4.2 of 111 users (111)
Rating 4.6 of 7 users Rating 4.6 of 7 users (7)