Constructors are

a- automatically called when your main() program instantiates an object
b- typically used to initialize an objects' data members
c- both a & b
d- none

c?

If the programmer does not explicitly define at least one constructor for a class

a- a compiler error will occur
b- the compiler implicitly creates a default constructor which does not perform any data member initialization
c- neither

c?

Using default arguments within a constructor definition

a- is not allowed by the compiler
b- is only valid if no other constructors are present within the class
c- allows for the initialization of data members when an object is first instantiated

c?

Which of the following is NOT true of a constructor and destructor of the same class

a- they both have same name aside from the tilde (~) char
b- they are both called once per object (in general)
c- they both are able to accept default arguments
d- both are called automatically, even if not defined in the class

d?

Thank You, egmik3

Recommended Answers

All 4 Replies

>c?
I suppose that would work, though the wording looks tricky.

>c?
You're so indecisive. One of them is right, so you can improve your chances to 50/50. :)

>c?
A pedantic view would say d for none of the above.

>d?
That's right, after a fashion, but you could be more right.

Try researching a little bit. Obviously we are not going to give you the answers, although if you notice, Narue does give some hints ;).

Here's some information for you:
http://www.parashift.com/c++-faq-lite/ctors.html
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.xlcpp8a.doc/language/ref/cplr376.htm

You won't understand all of this, but gather what you can to help you understand these questions.

So I am guessing

1 = C
2 = B
3 = (ill wait on this one)
4 = D? [ are you saying I am correct with what answers he has given us? or there is a better answer other than D that is provided?]


Thank you for the links! I have been looking all over for all of these HW questions they seem to be tricky.

-egmik3

3 = (ill wait on this one)

You were correct with your first guess.

4 = D? [ are you saying I am correct with what answers he has given us? or there is a better answer other than D that is provided?]

I believe it's the latter. ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.