c++ program for parameterized constructer - c program with parth patthar

c program with parth patthar

learn c and c++ in better way and with simple example.

Believe on your own logic

Saturday, November 24, 2018

c++ program for parameterized constructer

//parameter constructer


#include<iostream.h>
#include<conio.h>
class data
{
int a,b;
public:
data(int,int);
void put()
{
cout<<"\t"<<a<<"\t"<<b;
}
};
data::data(int x,int y)
{
a=x;
b=y;
}
int main()
{
clrscr();
data d1(4,5),d2(5,60);
d1.put();
d2.put();
getch();
return(0);
}

No comments:

Post a Comment