CPP Copy Constructor with Example | C++ Programming Video Tutorial

preview_player
Показать описание
In this c++ Video tutorial, you will learn to write a copy constructor for a class with example.

You will learn what are copy constructors, what is the syntax of writing them, what is the use of them, how to use assignment operator with the them, what happens when we copy an object, what problem they solve in detail with example.

Learn Programming in HINDI at our youtube channel

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

Sir, In line 22 you wrote *(this->name) = name; which gives the outcome that you are getting.
To avoid that outcome I've simply put this->name = &name, and works just fine.

gospodin
Автор

Thanks so much! This video is really useful! :)

DrakathSagittarius
welcome to shbcf.ru