Академический Документы
Профессиональный Документы
Культура Документы
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
~work() -function1
{cout<<un-allocated<<endl;}
i)Which member function out of
Void status()Function2
function1,function2,function3 and
{ cout<<workId<<:<<eorkType<<endl;}
function4 shown in above definition of
class work will be called an execution
work() function 3
of statement written as statement 1
{ workId=10;workType=T;}
and statement2?What are those
work(work &W)function4
functions specifically known as?
{ workId=w.workId+12;
workType=w.workType+1;
}
};
2008
Qs:-
class number
{ float M;
char str[25];
public:
number( )
//constructor 1
{ M=0;
str=\0;
}
number(number &t);
//constructor 2
};
For Synthetic