1. Template classes must have at least one static member.
Correct Answer is : FALSE
2. Which is the pointer which denotes the object calling the member function?
Correct Answer is : This pointer
3. Which among the following is true?
Correct Answer is : this pointer is passed implicitly when member functions are called
4. The this pointer is accessible __________________
Correct Answer is : Only within non-static functions
5. An object’s this pointer _____________________
Correct Answer is : Isn’t part of object itself
6. The result of sizeof() function __________________
Correct Answer is : Doesn’t include the space taken by this pointer
7. Whenever non-static member functions are called _______________
Correct Answer is : Address of the object is passed implicitly as an argument
8. Which is the correct interpretation of the member function call from an object, object.function(parameter);
Correct Answer is : function(&object,parameter)
9. The address of the object _________________
Correct Answer is : Is available inside the member function using this pointer
10. Which among the following is true?
Correct Answer is : This pointer can be used to guard against self-reference
11. Which syntax doesn’t execute/is false when executed?
Correct Answer is : if(&object != this)
12. The this pointers _____________________
Correct Answer is : Are non-modifiable
13. Earlier implementations of C++ ___________________
Correct Answer is : Allowed assignments to this pointer
14. This pointer can be used directly to ___________
Correct Answer is : To manipulate self-referential data structures
15. Which among the following is/are type(s) of this pointer?
Correct Answer is : const or volatile
16. Which is the correct syntax for declaring type of this in a member function?
Correct Answer is : [cv-qualifier-list] classType *const this;
17. How many types of constructors are available, in general, in any language?
18. Choose the correct option for the following code.
class student
{
int marks;
}
student s1;
student s2=2;
Correct Answer is : Program gives compile time error
19. Which constructor is called while assigning some object with another?
20. It’s necessary to pass object by reference in copy constructor because:
Correct Answer is : Constructor is not called in pass by reference