tell about copy constructor

Answer Posted / achal ubbott

e.g. Let there be a class

class Sample
{

};
suppose in main() you do like here

Sample obj1;
Sample obj2 = obj1; // Copy cons called here.
// then you call a function like this

fun(obj1); //Copy cons called here.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is this pointer in oop?

555


What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }

1981


Will I be able to get a picture in D drive to the c++ program? If so, help me out?

1657


What is object-oriented programming? Webopedia definition

723


What is the important feature of inheritance?

631






What is the real life example of polymorphism?

605


What is super in oop?

597


What is oops in simple words?

577


Where You Can Use Interface in your Project

1423


write a program to find 2^n+1 ?

1549


Why is static class not inherited?

593


What is protected in oop?

602


String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?

1941


What is abstraction encapsulation?

655


How many human genes are polymorphic?

570