25.8.0
This website uses cookies to ensure you get the best experience on our website. Learn more

OOP in C++: Instantiating Objects Using Constructors

Gaurav singh Yadav

Skillsoft issued completion badges are earned based on viewing the percentage required or receiving a passing score when assessment is required. 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.

Issued on

November 28, 2024

Expires on

Does not expire