944,139 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1079
  • C++ RSS
Dec 5th, 2006
0

Any Help Appreciated, Stumped on HW questions

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
egmik3 is offline Offline
34 posts
since Dec 2006
Dec 5th, 2006
0

Re: Any Help Appreciated, Stumped on HW questions

>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.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Dec 6th, 2006
0

Re: Any Help Appreciated, Stumped on HW questions

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/infoce...ef/cplr376.htm

You won't understand all of this, but gather what you can to help you understand these questions.
Team Colleague
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
John A is offline Offline
5,055 posts
since Apr 2006
Dec 6th, 2006
0

Re: Any Help Appreciated, Stumped on HW 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
Last edited by egmik3; Dec 6th, 2006 at 12:30 am.
Reputation Points: 10
Solved Threads: 0
Light Poster
egmik3 is offline Offline
34 posts
since Dec 2006
Dec 6th, 2006
0

Re: Any Help Appreciated, Stumped on HW questions

Click to Expand / Collapse  Quote originally posted by egmik3 ...
3 = (ill wait on this one)
You were correct with your first guess.

Quote ...
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.
Team Colleague
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
John A is offline Offline
5,055 posts
since Apr 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Segmentation fault in C++
Next Thread in C++ Forum Timeline: Help!!!So lost





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC