Order PDF of any content from our website with a little minor Fee to donate for hard work. Online MCQs are fully free but PDF books are paid. For details: contact whatsapp +923028700085 Important notes based PDF Books are available in very little price, starting from 500/-PKR; Order Now: contact whatsapp +923028700085

VU Past Papers CS201– C++ Pointers, & Operator Overloading MCQs

Q#1: Care must be taken about the correct ___ of operator while overloading. (Choose the most appropriate)
(A) Semantic *
(B) Complexity
(C) Both Semantic and Complexity
(D) None of the given options
Answer: (A) Semantic

Q#2: In functions that return reference, use ___
(A) global or local variables
(B) global or static variables *
(C) ordinary variables
Answer: (B) global or static variables

Q#3: In overloading the assignment (=) operator, which object(s) will call the operator function?
(A) Left object of the assignment operator *
(B) Right object of the assignment operator
(C) Both objects will call the operator function
(D) No object will call the operator function
Answer: (A) Left object of the assignment operator

Q#4: Friend functions are ___
(A) Unidirectional
(B) bidirectional *
(C) like inline functions
(D) private
Answer: (B) bidirectional

Q#5: We cannot increment ___
(A) pointers
(B) arrays *
(C) references
(D) Variables
Answer: (B) arrays

Q#6: A pointer is ___
(A) the address of a variable *
(B) an indication of the variable to be accessed next
(C) the data type of an address variable
Answer: (A) the address of a variable

Q#7: Overloaded assignment operator must be ___
(A) Member function of class *
(B) Non-member function of class
(C) Friend function of class
(D) Global function
Answer: (A) Member function of class

Q#8: The concept of friend function negates the concept of ___
(A) inheritance
(B) polymorphism
(C) persistence
(D) encapsulation *
Answer: (D) encapsulation

Q#9: If class A is a friend of class B, and class B is a friend of class C. If class A wants class C to be a friend, ___
(A) it has to declare class C as a friend *
(B) it has to declare class B as a friend
(C) it has to declare class A as a friend
(D) it has to declare class B and class A as friend classes
Answer: (A) it has to declare class C as a friend

Q#10: The difference between pointers and references is that ___
(A) we cannot do arithmetic with pointers
(B) we can do arithmetic with pointers *
(C) we cannot reassign pointers
(D) we can assign references
Answer: (B) we can do arithmetic with pointers

Q#11: A reference cannot be ___
(A) 1
(B) zero
(C) NULL *
(D) integer
Answer: (C) NULL

Q#12: An address is a ___, while a pointer is a ___
(A) constant, variable *
(B) variable, constant
(C) global, variable
(D) non-static variable, constant
Answer: (A) constant, variable

Q#13: The reference data types are used as ___ variables without any ___ operator
(A) ordinary, dereference *
(B) global, dot
(C) static, dereference
(D) local, &
Answer: (A) ordinary, dereference

Q#14: The syntax of declaration of a function that returns the reference to an integer is ___
(A) int & myfunc() ; *
(B) int myfunc();
(C) int myfunc() &;
(D) integer & myfunc();
Answer: (A) int & myfunc() ;

Q#15: References cannot be uninitialized. Because it is impossible to ___
(A) reinitialize a pointer
(B) reinitialize a reference *
(C) initialize a NULL pointer
(D) cast a pointer
Answer: (B) reinitialize a reference

Contents Copyrights Reserved By T4Tutorials