C++ Programming and Technical Programming Technical

Suppose that the foo class does not have an
overloaded assignment operator. What happens
when an assignment a=b; is given for two foo
objects?
a) The automatic assignment operator is used
b) The copy constructor is used
c) Compiler error
d) Run-time error

Read Solution (Total 4)

C++ Other Question

What does the term “default parameter” mean in
C++?
a) It means that the compiler supplies default functionality
that you get for "free".
b) A parameter that C++ automatically supplies a
default value for.
c) Some C++ functions have all the parameters
written for you by the compiler
d) A parameter based on primitive C++ variable
types.
Using the following declarations, which of the
following assignment statements are legal?
class A {...} ; class B: public A {...};
A a; B b, b1, b2;
a) a = b;
b) b = a;
c) b1 = b2;
d) Both (a) and (b) are legal, but not (c).
e) Both (a) and (c) are legal, but not (b).
f) Both (b) and (c) are legal, but not (a).