题目内容

Which of the following statements about copy constructor and conversion constructor is incorrect?

A. Both copy constructor and conversion constructor deal with the same data type
B. Copy constructor is used to create the same user-defined type
Conversion constructor can convert an object of a built-in type into an object of a user-defined type
D. Copy constructor means that the copy of a class object is a copy of each member, i.e. default member-wise initialization

查看答案
更多问题

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

答案查题题库