Welcome Visitor! Login | Sign Up | Help!
Refer a Friend
|
Follow us on:
More
Home » Ask & Discuss » Board Exams - CBSE, ICSE, State Boards » Computer Science « Back to Discussion
Computer Science
How many times is the copy constructor invoked in the following code? Mention when it is invoked also.Trial func(Trial u){Trial v(u);Trial w=v;return w;}void main(){Trial x;219Trial y=func(x);Trial z=func(y);}
two times func() is called
each time it is called 4 times copy constructors .
that r ::
1 . when d parameter is passed by value by u .
2. when v is initialized.
3. when w is initialized.
4.when w is returned .
so total 8 times .
Sorry i couldn't give d answer of ur other's question. Half of sys still left.
Thank u and All the best.
Name
Mobile No.
Physics.
General Physics
Mechanics
Optics
Thermal Physics
Electricity
Magnetism
Modern Physics
Mathematics.
Algebra
Trignometry
Analytical Geometry
Differential Calculus
Integral Calculus
Vectors
Chemistry.
Physical Chemistry
Organic Chemistry
Inorganic Chemistry
Biology
Botany
Zoology
Institutes
Coaching Institutes & Course Material
About IITs and JEE
Non IIT Institutes
Counselling Zone
Parents
Parent Discussion Board
Board
Course Material
Fun Zone
Lounge
Games, Puzzles and Quizzes
General Knowledge
two times func() is called
each time it is called 4 times copy constructors .
that r ::
1 . when d parameter is passed by value by u .
2. when v is initialized.
3. when w is initialized.
4.when w is returned .
so total 8 times .
Sorry i couldn't give d answer of ur other's question. Half of sys still left.
Thank u and All the best.