Get up to 80 % extra points for free! More info:

Lesson 11 - Copy Constructors in C++

In the previous lesson, Overloading operators in C++, we explained operator overloading. In today's C++ tutorial, we're going to look at another type of constructors - the copy constructor. But don't worry, we didn't learn operators for nothing. The next C++ tutorial will focus on one of them - the assignment operator.

Copy Constructor

What's a copy constructor? As the name suggests, it's a constructor - so it's used to create new instances as we know from past lessons. And we call it the copy constructor because it's being used when the instance is being copied. And as we already know, the instance is copied every time we


 

...End of the preview...
Continue further

You will gain knowledge worth hundreds of thousands for a few crowns

You've come here and that's great! We believe that the first lessons showed you something new and useful
Do you want to continue the course? Go to the premium section.

Buy this course

Buy all currently available lessons with exercise submitting and other features for just $14.40
Current account balance $0
By buying this package, you'll have access to all 24 articles (24 lessons) in this course.

This article is licensed: Premium, by buying this article, you agree with the terms of use.

What will you get from us in the next lessons?
  • Unlimited and permanent access to individual lessons.
  • High quality IT knowledge.
  • Skills to help you get your dream and well-paid job.

Article description

Requested article covers this content:

In this C++ tutorial, we'll talk about copy constructors, what are they for and how to implement them properly.

You gain credits by supporting our network. This is done by sending a helpful amount of money to support the site, or by creating content for the network.

Article has been written for you by David Capka Hartinger
Avatar
The author is a programmer, who likes web technologies and being the lead/chief article writer at ICT.social. He shares his knowledge with the community and is always looking to improve. He believes that anyone can do what they set their mind to.
Unicorn university David learned IT at the Unicorn University - a prestigious college providing education on IT and economics.
Activities