Which of the following operators are overloaded by default by the compiler in every user defined classes even if user has not written?(1) comparsion operator (==)(2) assignment operator (=)
A. both (1) and (2)
B. only (1)
C. only (2)
D. none of the two
查看答案
Which of the following operators should be preferred to overloaded as a global function rather than a member function?
A. postfix++
B. comparison operator
C. insertion operator << (or extraction operator >>)
D. prefix ++
How does C++ compiler differ between overloaded postfix and prefix unary operators?
A. C++ does not allow both operators to be overloaded in a class.
B. A postfix ++ has a dummy parameter
C. A prefix ++ has a dummy parameter
D. By making prefix ++ as a global function and postfix as a member function
Which of the following operator functions cannot be global, i.e., must be a member function?
A. new
B. delete
C. conversion operator
D. All of the above
Which of the following operator functions cannot be global, i.e., must be a member function?
A. ()
B. []
C. =
D. all of the above