How many independent objects can be returned at same time from a function?
1.1
2.2
3.3
4.4
If object is passed by reference ____________________
1.Temporary object is created
2.Temporary object is created inside the function
3.Temporary object is created for few seconds
4.Temporary object is not created
In which of the following way(s) can the object be returned from a function?
1.Can only be returned by value
2.Can only be returned by reference
3.Can be returned either by value or reference
4.Can neither be returned by value nor by reference
Which among the following is true?
1.Two objects can point to the same memory location
2. Two objects can never point to the same memory location
3.Objects not allowed to point at a location already occupied
4.Objects cant point to any address
Can we return an array of objects?
1.Yes, always
2.Ye, only if objects are having same values
3.No, because objects contain many other values
4.No, because objects are single entity
If an object is being returned by value then __________________________
1.Its member values are made constant
2.Its member values have to be copied individually
3.Its member values are not used
4.Its member values are copied using copy constructor
If an object is declared inside the function then ____________________ outside the function.
1. It can be returned by reference
2.It cant be returned by reference
3.It can be returned by address
4.It cant be returned at all
Whenever an object is returned by value ____________________
1.A temporary object is created
2.Temporary object is not created
3.Temporary object may or may not be created
4.New permanent object is created
Where the temporary objects (created while return by value) are created?
1.Outside the function scope
2.Within the function
3.Inside the main function
4.Inside the calling function
Which among the following is correct?
1. Individual data members cant be returned
2.Individual data members can be returned
3.Individual member functions can be returned from another function
4. Individual data members can only be passed by reference
Which error will be produced if a local object is returned by reference outside a function?
1.Out of memory error
2.Run time error
3. Compile time error
4.No error
Which is the correct syntax for defining a function which passes an object by reference?
1. className& functionName ( )
2.className* functionName( )
3.className-> functionName( )
4. &className functionName()
Which is the correct syntax for returning an object by value?
1.void functionName ( ){ }
2.object functionName( ) { }
3.class object functionName( ) { }
4. ClassName functionName ( ){ }
Why temporary object is not created in return by reference?
1.Because compiler cant create temporary objects
2. Because the temporary object is created within the function
3.Because return by reference just make the objects points to values memory location
4.Because return by reference just make the object point to null