C++ Question Answer’s In Hindi : What is Copy Constructor?

C++ Question Answer’s In Hindi : What is Copy Constructor  Explain With Example:- Hello Friend’s, This is shubham And i am Back With this QA Series Of C++. In this Series you Will Gets Most important Question’s And Answers’s For Your Exam.. Show Let’s Get Started… As You Can See in The Title Here is our Fourth Question..


Q.4. -What Is Copy Constructor ( Copy constructor Kya hai?)

Yeh ek aisi process hai jiska use karke ek object ko kisi dusre object ke dwara create karne ke liye kiya jata hai. “it means It’s a process When a new object is created from an existing object is Called Copy Constructor.” Copy Constructor me arguments ke roop me object ko pass kiya jaata hai aur old Object ki Value new object me Copy ho jaati hai. Ager Class me copy Constructor Define nahi kiya hai to Complier Khud hi Use Create kar leta hai jise Default Copy-Constructor Kaha jata hai. Use of copy constructor in c++:-

  • same class me ak object ke dwara dusre object ka initialization karne ke liye.
  • Object ko As a function value return karne ke liye.
  • Function se return aane per Object ki Value Copy karne ke liye.





class bank


int ano;

char name[20];

int bal;  


void get()

{ cout<<“Enter account no= “;      cin>>aon;

cout<<“Enter Name= “;    cin>>name;

cout<<“Enter Balance= “;     cin>>bal;

}    void show()

{  cout<<ano<<“\t”<<name<<“\t”<<bal<<“\n”;



{ano = 15050;

strcpy(name , “Ravi”);

bal = 60000;


bank (bank & r)


ano= r.ano;

strcpy(name, r.name);

bal= r.bal;

}  };

void main()

{ clrscr();

bank b1;


bank b2(b1);




Iss program Me pahle Hamne Constructor ko Create kiya Uske baad r ke refference ka use karke pahle b1 object se get() function ko access kiya fir b1 se b2 me constructor copy karke b2 object ko show() function ko access kiya. “What is Copy Constructor  Explain With Example


To guys Apko Meri Ye Post “C++ Question Answer’s In Hindi : What is Copy Constructor  Explain With Example”  kaisi Lagi Hame Jarur Bataye Apne Comments Ke madhyam Se.. Aur Koi Q Ho To Aap Hamse Puch Sakte Hai.. Post Achi Lagi To Share Karna Na Bhule..

Leave a Reply

Your email address will not be published. Required fields are marked *

Show Buttons
Hide Buttons