C++ Tutorial: Copy Constructors

preview_player
Показать описание
A copy constructor is a special type of constructor often used to resolve issues with classes and pointers.

In this video we examine the problem pointers can cause classes and how the copy constructor can be used to resolve it.

We also examine three situations in which the copy constructor can be invoked and give examples of each.

We examine the idea in the abstract with memory sketches and in the concrete with simple code examples.

Рекомендации по теме
Комментарии
Автор

I can't believe that video has so low view count. I found it for helpful thanks. Maybe if you include <more_tags> in the video description will help get more outside of the private section.

DarkGT
Автор

Well explained Professor Hank. Thank you!

ksp
Автор

Thank you very much for making this video!

toan
Автор

Great video i get the idea thank you very match

MrEmpirz
Автор

At 12:57, spam function is used to pass an object into copy constructor.
Can anyone tell me what the function is.
I looked for various kinds of websites but was unable to find it.

cafelashowerezweb
Автор

Great tutorial Prof Hank. Have a little doubt tho, I'm not able to call the copy constructor when I do this in my main function, Demo* dog = new dog; Demo* cat = dog; I have written the copy constructor as in the video Demo (const Demo& d) { cout << "called" << endl;}

beetisushruth
visit shbcf.ru