Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Copying and Copy Constructors in C++

The Cherno via YouTube

Overview

Explore the intricacies of copying and copy constructors in C++ through this 21-minute video tutorial. Delve into the necessity of copying objects and data in C++ programming, and learn how to implement copy constructors for custom types to perform deep copies when required. Understand the potential performance implications of copying and discover strategies to avoid unnecessary copying. Gain insights into memory management, string handling, and the concept of deep copying. Follow along with code examples and practical demonstrations to grasp the implementation of copy constructors, disabling copy constructors, and working with references. Master the fundamentals of efficient object copying in C++ to enhance your programming skills and optimize your code.

Syllabus

Intro
Copying
String
Memory leak
Copy constructor
Disable copy constructor
Deep copy
Running the code
Printing the string
Staking a reference
Summary
Outro

Taught by

The Cherno

Reviews

Start your review of Copying and Copy Constructors in C++

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.