and destructor
and class and object
Pournomi Sen
PGT,Comp Sc
K.V Ballygunge
2009
1)What is copy constructor?Give an
example in C++ to illustrate copy
constructor. (2)
2)Answer the questions i)and ii) after
going through the following class
Class work
{
Int workId;
Char workType;
ii)Work w; statement1
Public:
Work y(w);statement2
{cout<<un-allocated<<endl;}
Void status()Function1
i)Which member function out of
{ cout<<workId<<:<<eorkType<<endl;}
function1,function2,function3 and
work() function 2
function4 shown in above definition of
class work will be called an execution
{ workId=10;workType=T;}
of statement written as statement 1
work(work &W)function3
and statement2?What are those
{ workId=w.workId+12;
functions specifically known as?
workType=w.workType+1;
}
~work() -function4
};
2008
Qs:-
class number
{ float M;
char str[25];
public:
number( )
//constructor 1
{ M=0;
str=\0;
}
number(number &t);
//constructor 2
};
For Synthetic