You are on page 1of 1

#include<iostream.

h>
#include<conio.h>
#include<string.h>
class RETAIL
{
char category[20],type[20];
int qty;
float price,bill;
public:
RETAIL() //DEFAULT CONSTRUCTER
{
strcpy(category,"XYZ");
strcpy(type,"abe");
qty=0;
price=0;
bill=0;
}
RETAIL(char*a,char*b,int c, float d,float e)//PARAMETERIZED CONSTRUCTER
{
strcpy(category,a);
strcpy(type,b);
qty=c;
price=d;
bill=e;
}
RETAIL(RETAIL &i)//COPY CONSTRUCTOR
{
strcpy(category,i.category);
strcpy(type,i.type);
qty=i.qty;
price=i.price;
bill=i.bill;
}
void disp()
{
cout<<category<<"\t"<<type<<"\t"<<qty<<"\t"<<price<<"\t"<<bill<<endl; }
~RETAIL()//DESTRUCTOR
{
cout<<"end of object of class!!!!!!!"<<endl; } };
void main()
{
clrscr();
RETAIL q;
RETAIL r("GH","HJ",7,8.9,9.7);
RETAIL p=r;
p.disp();
q.disp();
r.disp();
getch();
}

You might also like