473,465 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Put Back Functions

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
5 1594

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
"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

"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

"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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: Digital Puer | last post by:
I'm looking at some software development jobs whose listings require C++ experience. My history is that I have a strong C background, and a few years of C++ from undergrad classes. I've been...
9
by: jcnews | last post by:
When designing a webpage, is there a way to disable the back button? It must be possible. I am asking because there are certain web applications that I have used that require the user to...
25
by: KK | last post by:
Hi, I am using history.go(-1) for implementing the back button functionality. Its working fine but with this exception. 1. The page which is having back button has some hyperlinks on it. ...
32
by: Kamilche | last post by:
I'm looking at other languages. Some of them fool me into thinking they're useful, and I change my home page to them... 'comp.lang.c++' for instance. But I always end up switching it back to...
10
by: Aaron | last post by:
I taught myself C++ a while back, but never got to involved in actually writing applications with it. I actually spent the last 6 years working for numerous internet web firms as well as doing a...
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
182
by: Jim Hubbard | last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
5
by: The alMIGHTY N | last post by:
Hi all, Let's say I have a simple math formula: sum (x * y / 1000) / (sum z / 1000) I have to do this across 50 items, each with an x, y and z value, when the page first loads AND when a...
11
by: sameer.oak | last post by:
I am looking for some comprehensive tutorials on how to write call back functions in C. Can anyone help me? - sameer oak.
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.