What is the difference between a struct and a class? a. constructors and destruc
ID: 675053 • Letter: W
Question
What is the difference between a struct and a class?
a. constructors and destructors are allowed for the class
b. member functions are allowed for the class
c. members are private by default for the class
d. copying is not allowed for the struct
e. none of the above
Which of the following should be placed in a header file?
a. class interface
b. class implementation
c. inline function bodies
d. (a) and (c)
e. (a), (b), and (c)
When a parameter is passed call by value, what functions are guaranteed to be called?
a. zero-parameter constructor
b. copy constructor
c. destructor
d. operator=
e. two or more of the above
When is a destructor not called?
a. A local automatic variable goes out of scope
b. A pointer variable goes out of scope
. delete
d. delete []
e. Destructors are called in all instances
A constant member function means that:
a. All of the parameters are constant
b. The object being acted upon is a constant
c. The parameters are not passed using call by value
d. The result of the function call cannot be assigned to
e. none of the above
Initializer lists are used in:
a. assignment operators
b. all member functions
c. constructors
d. destructors
e. friend functions
Explanation / Answer
1.
e. none of the above
2.
e. (a), (b), and (c)
3.
a. zero-parameter constructor
4.
a. A local automatic variable goes out of scope
5.
b. The object being acted upon is a constant
6.
c. constructors
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.