Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

copy constructor in c++ questions

#include<iostream> 
using namespace std; 
class ABC { 
 public:ABC(){
    cout<<"Constructor is called automatically";
    cout<<"at the time of execution"<<endl;
 }
 void display(){
        cout<<"hello world";
 } 
}; 

int main() { 
 ABC ob1,ob2;
 ob1.display();
 ob2.display();
 return 0;  
}
Source by www.mygreatlearning.com #
 
PREVIOUS NEXT
Tagged: #copy #constructor #questions
ADD COMMENT
Topic
Name
7+9 =