By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,193 Members | 826 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,193 IT Pros & Developers. It's quick & easy.

Put Back Functions

P: n/a
I have these interview questions and could use some help in polishing
my knowledge:

a) what are put back functions?
b) is containment better than private inheritence?
(please contrast it with composition)
c) can we have flat out separate classes with friend functions?
Thanks for your help

Jul 23 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a

Last Timer wrote:
I have these interview questions and could use some help in polishing
my knowledge:

a) what are put back functions?
Search the net for "streambuf"
b) is containment better than private inheritence?
(please contrast it with composition)
This is discussed all over the net. Try "www.google.com"
c) can we have flat out separate classes with friend functions?

I have no idea what this means.

Hope this helps,
-shez-

Jul 23 '05 #2

P: n/a
"Last Timer" <da********@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I have these interview questions and could use some help in polishing
my knowledge:

a) what are put back functions?
Functions which cause previously extracted data from
a stream to be resubmitted to a subsequent extraction.
Note that 'put-back' functions are restricted in
what they can do. See a good C++ text for details.
b) is containment better than private inheritence?
Better for what? Without context, this question cannot
have a 'correct' or 'incorrect' answer.
(please contrast it with composition)
Inheritance expresses an 'is a' relationship between
types. Composition expreses a 'has a' relationship
between types.
c) can we have flat out separate classes with friend functions?


Yes. But whether doing so is a good idea depends upon
context.

I suggest that you do your 'polishing' by reading some
good C++ texts, rather than simply asking ad hoc questions
here. See www.accu.org for peer reviews.

Have you read the C++ FAQ?
http://www.parashift.com/c++-faq-lite/

-Mike
Jul 23 '05 #3

P: n/a

"Mike Wahler" <mk******@mkwahler.net> wrote in message
news:j1****************@newsread1.news.pas.earthli nk.net...
"Last Timer" <da********@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I have these interview questions and could use some help in polishing
my knowledge:

a) what are put back functions?
Functions which cause previously extracted data from
a stream to be resubmitted to a subsequent extraction.
Note that 'put-back' functions are restricted in
what they can do. See a good C++ text for details.
b) is containment better than private inheritence?


Better for what? Without context, this question cannot
have a 'correct' or 'incorrect' answer.
(please contrast it with composition)


Inheritance expresses an 'is a' relationship between
types.


This is true only for public inheritance .. the OP's question was about
private inheritance, which expresses an "is implemented in terms of"
relationship between types.
Composition expreses a 'has a' relationship
between types.
Usually, but it can also express "is implemented in terms of", for example
in the case of the useful pimpl idiom.
c) can we have flat out separate classes with friend functions?

What does "flat out separate classes" mean?
Yes. But whether doing so is a good idea depends upon
context.

[snip]

Dave Moore
Jul 23 '05 #4

P: n/a

"Dave Moore" <dt*****@email.unc.edu> wrote in message
news:36*************@individual.net...

What does "flat out separate classes" mean?


In my experience, "flat out" is often used to mean "completely" or
"totally". I'd assume that he means there is no inheritance between the
classes, nor any containment of one by the other (or of pointers or
references to each other).

Of course, assumptions are not always accurate... in fact they're sometimes
flat out wrong! :-)

-Howard

Jul 23 '05 #5

P: n/a

Howard wrote:
"Dave Moore" <dt*****@email.unc.edu> wrote in message
news:36*************@individual.net...

What does "flat out separate classes" mean?

In my experience, "flat out" is often used to mean "completely" or
"totally". I'd assume that he means there is no inheritance between

the classes, nor any containment of one by the other (or of pointers or
references to each other).

Of course, assumptions are not always accurate... in fact they're sometimes flat out wrong! :-)

-Howard


Hmmm... but why would we need to qualify it with "flat out"... wouldn't
just "separate classes" be sufficient without changing the meaning?...
;)

-shez-

Jul 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.