OOP in C++: Copy Constructors, Nested Classes, & Namespaces

C++ 20    |    Intermediate
  • 13 Videos | 1h 42m 57s
  • Earns a Badge
A copy constructor in C++ classes is a specialized method used to create an object from another object of the same class. Other specialized C++ methods include nested classes and namespaces, which organize different classes in a logical and coherent manner while avoiding name conflicts. In this course, learn how to specify and use a copy constructor. Next, discover how classes and functions can be marked as friends. Finally, examine how nested classes can be defined and used in C++ and practice using namespaces to modularize your code. After completion of the course, you'll be able to create and implement a custom copy constructor, access private variables using friend functions and classes, and store functions and classes in namespaces.

WHAT YOU WILL LEARN

  • discover the key concepts covered in this course
    create copies of objects using C++'s default copy constructor
    implement a custom copy constructor
    use pass-by-value and pass-by-reference semantics with objects
    create a copy of an object containing pointers
    identify the errors that can result from using the default copy constructor
    implement copy constructors for a class containing pointers
  • access private variables using friend functions and classes
    create private and public nested classes
    identify and use the global namespace
    store functions and classes in namespaces
    create and reference namespaces
    summarize the key concepts covered in this course

IN THIS COURSE

  • Playable
    1. 
    Course Overview
    2m 7s
    UP NEXT
  • Playable
    2. 
    Creating Copies Using a Copy Constructor
    8m 23s
  • Locked
    3. 
    Implementing Copy Constructors
    7m 29s
  • Locked
    4. 
    Using Pass-by-value and Reference with Objects
    6m 44s
  • Locked
    5. 
    Creating Required Copy Constructors
    7m 45s
  • Locked
    6. 
    Identifying Default Copy Constructor Errors
    9m 16s
  • Locked
    7. 
    Implementing Copy Constructors for Object Pointers
    5m 22s
  • Locked
    8. 
    Creating Friend Functions and Classes
    11m 10s
  • Locked
    9. 
    Creating Nested Classes
    10m 59s
  • Locked
    10. 
    Implementing Namespaces
    8m 14s
  • Locked
    11. 
    Storing Functions and Classes in Namespaces
    10m 54s
  • Locked
    12. 
    Creating and Referencing Namespaces
    11m 15s
  • Locked
    13. 
    Course Summary
    3m 20s

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.