OOP in C++: Instantiating Objects Using Constructors

C++    |    Intermediate
  • 8 videos | 49m 51s
  • Includes Assessment
  • Earns a Badge
Rating 4.4 of 9 users Rating 4.4 of 9 users (9)
A constructor is a special method of a class invoked when an object of that class is created. Constructors have a fair bit of complexity, and can be chained to achieve code reuse and marked as explicit to avoid unexpected type promotions and object creation. In this course, examine the important aspects of constructor syntax, such as specifying default arguments and correctly using initialization lists. Next, learn how to chain constructors and retain most of the code functionality in one constructor. Finally, learn how constructors might be invoked automatically by the C++ runtime to create objects for method invocations. After completion of the course, you'll be able to correctly initialize variables using initialization lists, connect constructors using constructor chaining, and create structs.

WHAT YOU WILL LEARN

  • Discover the key concepts covered in this course
    Add default arguments to constructors
    Initialize variables using initialization lists
    Explore finer points of initialization lists
  • Connect constructors using constructor chaining
    Prevent implicit type conversions using the explicit keyword
    Create structs and contrast them with classes
    Summarize the key concepts covered in this course

IN THIS COURSE

  • 1m 48s
  • 7m 26s
  • Locked
    3.  Initializing Variables Using Initialization Lists
    9m 6s
  • Locked
    4.  Distinguishing the Nuances of Initialization Lists
    5m 40s
  • Locked
    5.  Execute Constructor Chaining
    8m 31s
  • Locked
    6.  Implementing the explicit Keyword
    9m 41s
  • Locked
    7.  Creating Structs in C++
    4m 32s
  • Locked
    8.  Course Summary
    3m 7s

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 4.5 of 53 users Rating 4.5 of 53 users (53)
Rating 4.4 of 9 users Rating 4.4 of 9 users (9)
Rating 4.5 of 6 users Rating 4.5 of 6 users (6)

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE

Rating 4.5 of 18 users Rating 4.5 of 18 users (18)
Rating 4.5 of 53 users Rating 4.5 of 53 users (53)
Rating 4.7 of 14 users Rating 4.7 of 14 users (14)