Any Help Appreciated, Stumped on HW questions

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2006
Posts: 29
Reputation: egmik3 is an unknown quantity at this point 
Solved Threads: 0
egmik3's Avatar
egmik3 egmik3 is offline Offline
Light Poster

Any Help Appreciated, Stumped on HW questions

 
0
  #1
Dec 5th, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,660
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 725
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Any Help Appreciated, Stumped on HW questions

 
0
  #2
Dec 5th, 2006
>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.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 5,051
Reputation: John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold 
Solved Threads: 332
Team Colleague
John A's Avatar
John A John A is offline Offline
Vampirical Lurker

Re: Any Help Appreciated, Stumped on HW questions

 
0
  #3
Dec 6th, 2006
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.
"Technological progress is like an axe in the hands of a pathological criminal."

All my posts may be freely redistributed under the terms of the MIT license.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 29
Reputation: egmik3 is an unknown quantity at this point 
Solved Threads: 0
egmik3's Avatar
egmik3 egmik3 is offline Offline
Light Poster

Re: Any Help Appreciated, Stumped on HW questions

 
0
  #4
Dec 6th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 5,051
Reputation: John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold 
Solved Threads: 332
Team Colleague
John A's Avatar
John A John A is offline Offline
Vampirical Lurker

Re: Any Help Appreciated, Stumped on HW questions

 
0
  #5
Dec 6th, 2006
Originally Posted by egmik3 View Post
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.
"Technological progress is like an axe in the hands of a pathological criminal."

All my posts may be freely redistributed under the terms of the MIT license.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC