Q.1.
In how many ways can an object be passed to a function?
Q.2.
If an object is passed by value _____________
Q.3.
Pass by address passes the address of object _________ and pass by reference passes the address of the object _________
Q.4.
If an object is passed by reference, the changes made in the function ___________
Q.5.
Constructor function is not called when an object is passed to a function, will its destructor be called when its copy is destroyed?
Q.6.
When an object is returned by a function, a _______________ is automatically created to hold the return value.
Q.7.
Is the destruction of temporary object safe (while returning object)?
Q.8.
How to overcome the problem arising due to destruction of temporary object?
Q.9.
How many objects can be returned at once?
Q.10.
What will be the output of the following code? Class A { int i; public : A(int n) { i=n; cout<<”inside constructor ”; } ~A() { cout<<”destroying ”<<i; } void seti(int n) { i=n; } int geti() { return I; } }; void t(A ob) { cout<<”something ”; } int main() { A a(1); t(a); cout<<”this is i in main ”; cout<<a.geti(); }
Q.11.
It is necessary to return the object if it was passed by reference to a function.
Q.12.
How many objects can be passed to a function simultaneously?
Q.13.
If an object is passed by address, will be constructor be called?
Q.14.
Is it possible that an object of is passed to a function, and the function also have an object of same name?
Q.15.
Passing an object using copy constructor and pass by value are same.