#include<iostream.h>
class Exforsys();
{
private:
int a;
public:
Exforsys()
{}
Exforsys(int w)
{
a=w;
}
Exforsys(Exforsys& e)
{
a=e.a;
cout<<"Example of Copy Constructor";
}
void result()
{
cout<<a;
}
void main()
{
Exforsys e1(50);
Exforsys e3(e1); cout<<"\ne3="; e3.result();
}
}
itpipx 0 Newbie Poster
Intrade 33 Junior Poster
vidit_X 29 Junior Poster
stevanity 4 Posting Whiz in Training
Intrade 33 Junior Poster
itpipx 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.