HDTenEightyP/NetNews huggingface dataset:
From: hood@ualr.edu
Newsgroups: comp.lang.c++
Subject: ARM
Summary: What is ARM?
Keywords: arm
Date: 17 Nov 92 21:45:11 GMT
Reply-To: hood%eivax@ualr.edu
Followup-To: poster
Organization: University of Arkansas at Little Rock

What is ARM and how can I get a copy?

Thanks,

Bill Hood
University of Arkansas at Little Rock
Internet: hood%eivax@ualr.edu
Newsgroups: comp.lang.c++
From: georgew@hspice.portal.com ()
Subject: OMTool
Organization: Meta-Software Inc., Campbell, CA
Distribution: usa
Date: Fri, 20 Nov 1992 18:50:16 GMT

-
     Does anyone know who within the General Electric monolith would be able
to talk to me about an evaluation copy of OMTool?  I've been bouncing from
800 number to 800 number.

     (Object Model Tool is a graphic editor used to contruct object diagrams
using the OMT methodology.  OMT is the methodology Rumbaugh and Co. use in
their book "Object-oriented Modeling and Design.")

							George


-- 
----
George J Wu,  georgew@hspice.portal.com or georgew@metasw.com
Meta-Software,  1300 White Oaks Road,  Campbell, CA 95008,  (408) 369-5400
Never be the first to believe.  Never be the last to deceive.  ---  Chess
Newsgroups: comp.lang.c++
From: rmartin@thor.Rational.COM (Bob Martin)
Subject: Re: question on REFERENCES
Organization: Rational
Date: Fri, 20 Nov 1992 17:53:16 GMT

kestes@nswc-wo.nswc.navy.mil (Kent Estes) writes:

|Hello netters,  

|I am working on a function that references objects via id.  Upon finding
|an object, it returns a reference to that object.  My question is :
|if the object is not found, what is the best way to handle this.  If 
|I were returning pointers to objects, all I would have to do is
|return NULL.

My own preference is to return pointers if the functon can fail, and
to return references only if the function cannot fail, or uses
exceptions to report the failure.

This provides a very convenient paradigm, to wit: References never
need to be checked, pointers always do.  This works equally well for
function arguments where references must always be valid, but pointers
may be zero.



--
Robert Martin                        Training courses offered in:
R. C. M. Consulting                       Object Oriented Analysis
2080 Cranbrook Rd.                        Object Oriented Design
Green Oaks, Il 60048 (708) 918-1004       C++
Newsgroups: comp.lang.c++
Subject: Can someone please help me with streams?
From: ECSC9120802J@LUST.LATROBE.EDU.AU (GRANT,David)
Date: Wed, 18 Nov 1992 03:35:05 GMT
Organization: La Trobe University
X-News-Reader: VMS NEWS 1.24


I a new programmer to c++, and at the moment I am having trouble with streams.
I have overloaded the istream operator >>, to read in character by charater and
copy into an array. (It does a few other things as well.) The trouble I am
having is that I can't get it to recognise spaces or carrage returns. It just
seems to ignore them totally. I was wondering how I can get it to recognise
these characters, as it is inportant to my program. 
	Thanks for any help that I recieve, I will be eternally greatful. Also,
if I have asked a stupid question, or am missing the point somewhere, then
just tell me! Also I am compiling on my PC using Dos. I don't know if this is a
factor or not. Thanks again.

David.

----------------------------------------------------------------------------
David Grant		            |  "No one would suurender to the 
"The Dread Pirate Roberts"          |   Dread Pirate Westly"
ecsc9120802j.lust.latrobe.edu.au    | 		 - The Princess Bride.
or  9120802j.lux.latrobe.edu.au     |  P.S "La domo estas bela!"
----------------------------------------------------------------------------
Newsgroups: comp.lang.c++
From: drraymon@watdragon.uwaterloo.ca (Darrell Raymond)
Subject: Re: New Employee Test
Organization: University of Waterloo
Date: Fri, 20 Nov 1992 14:22:25 GMT

In article <mg.722138129@tyrolia>, mg@tyrolia (Michael Golan) writes:
> wbader@pluto.csee.lehigh.edu (William Bader) writes:
> 
> >Where I work, we ask people to write a short program that breaks a line
> >into words.
> 
> Ah, but can they use strtok() ?

  Or how about just

  		tr ' ' '\012'

  :-)

-Darrell.
Newsgroups: comp.lang.c++
From: pbray@firebird.newcastle.edu.au (Peter Bray)
Subject: Binary File Streams (iostream derived)
Summary: Question regarding a "binary" mode for fstreams
Keywords: Binary Streams
Organization: Application Specific Computer Design, The University of Newcastle
Date: Mon, 23 Nov 1992 00:38:13 GMT


	Having just finished looking thru two book and the AT&T C++ v3.01
manual pages, I was wondering if there was a simple interface to binary file
streams, or whether one must open the file as usual and just use the 

	ostream& write( const unsigned char* ptr, int n )

interface and develop member I/O functions (wrappers), for each class for which
one desires binary I/O.

Peter

------------------------------------------------------------------------------
Peter Bray: Application Specific Computer Design      Phone : (049) 21 5963
            Dept. Electrical & Computer Engineering   Fax   : (049) 60 1712
            University of Newcastle                   Email : InterNet/AARNet
            Callaghan NSW 2308  AUSTRALIA         pbray@ascod.newcastle.edu.au
------------------------------------------------------------------------------
Newsgroups: comp.lang.c++
From: chiu@snoopy.stdavids.picker.com (Arnold Chiu)
Subject: Call interfaces
Organization: Picker International, St. Davids
Distribution: comp.lang.c, comp.lang.c++
Date: Mon, 23 Nov 1992 14:51:38 GMT


Someone told me that you can call C++ routines from within
a C program, and vice versa.  How is this done?

Any ideas will be much appreciated.

Please send mail to me directly at chiu@stdavids.picker.com

Thanks.		Arnold.
Newsgroups: comp.lang.c++
From: moudgill@cs.cornell.edu ( Mayan Moudgill)
Subject: Manips rewritten to use Templates?
Organization: Cornell Univ. CS Dept, Ithaca NY 14853
Date: Mon, 23 Nov 1992 00:27:37 GMT

Has anyone written/knows where to find iostreams with manips written as templates,
instead of macros?

:)
Mayan
Newsgroups: comp.lang.c++
From: pvonk@scott.skidmore.edu (Pierre VonKaenel)
Subject: Latest Dr. Dobbs special C++ issue
Organization: Skidmore College, Saratoga Springs NY, 12866
Distribution: na
Date: Tue, 24 Nov 1992 00:38:39 GMT


Just received the latest Dr Dobbs Journal.  It came in two issues -
one is a special issue on C++ and includes an interview with B.
Stroustrup, a discussion of templates, and other tidbits.

-- 
Pierre von Kaenel	| Skidmore College	     | pvonk@skidmore.edu
Math & CS Dept.		| Saratoga Springs, NY 12866 | (518)584-5000 Ext 2391

"Experience is the name everyone gives to their mistakes." Oscar Wilde
Newsgroups: comp.lang.c++
From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
Subject: Re: Finding memory leaks
Keywords: OOP,memory leaks
Organization: Computer Science, University of Melbourne, Australia
Date: Mon, 23 Nov 1992 02:47:40 GMT

steve@taumet.com (Steve Clamage) writes:

>mpk9172@ultb.isc.rit.edu (M.P. Kirby) writes:
>
>>In C I used to use a memory leak finder that would help me find
>>my memory leaks.  I basically created a #define for malloc that redefined
>>it ...
>
>>I would like to do the same kind of thing in C++.  Unfortunately, it
>>seems that new is not as easy to #define over as malloc.  I thought
>>(briefly) that I could do something like #define new new(__LINE__,__FILE__) 
>> and then overload the new operator, but this causes a recursive macro.
>
>There have been two answers to this question that completely missed
>the point.  You do NOT want to replace "new" with a macro.  "new" is
>a keyword which causes constructors to be called, and memory to be
>allocated via the function "operator new()".  If you replace the "new"
>keyword with a macro, you destroy the semantics of most programs.

Unfortunately, we DO want to replace "new" with a macro, so that we can
get __LINE__ and __FILE__. Redefining operator new() is not sufficient, because
__LINE__ inside operator new() refers to the line where operator new() was
redefined, not the line where new was invoked.

The problem is not that "new" causes constructors to be called: we can solve
that by invoking "new" from within the macro definition. Neither is the
problem with recursive macros: as noted previously, they are quite OK.
The problem is that the macro preprocessor is not capable of replacing
all uses of keyword "new" which will cause calls to "::operator new()"
without also affecting other uses of the "new" keyword.
(Vector new and delete might also cause some other problems.)

The only way that I can see of solving the problem is to write a preprocessor
which properly parses the source code, and then does the desired replacements.
I don't see how it could be done using just the simple textual substitution
provided by the C preprocessor.

-- 
Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
This .signature virus is a self-referential statement that is true - but 
you will only be able to consistently believe it if you copy it to your own
.signature file!
Newsgroups: comp.lang.c++
From: bruceb@ctpm.uq.oz.au (Bruce Blackshaw)
Subject: Using *new* safely
Summary: Using new in constructors
Keywords: new
Organization: Centre for Language Teaching and Research, Uni of Queensland, AUSTRALIA.
Date: 18 Nov 92 22:13:24 GMT

I'm interested in how to safely use the new operator in the constructor of
a complex object - if you are dynamically allocating the instance of a class
that itself dynamically allocates in its constructor, how do you stop crashes
due to failure of new?


--
****************************************************
Bruce Blackshaw bruceb@ctpm.uq.oz.au   
"... I'd rather be hang gliding ..."
****************************************************
Newsgroups: comp.lang.c++
From: swillden@news.ccutah.edu (Shawn Willden)
Subject: Re: New Employee Test
Organization: University of Utah Computer Center
X-Newsreader: Tin 1.1 PL3
Date: Thu, 19 Nov 92 18:45:53 GMT

je@unix.brighton.ac.uk (John English) writes:
: assist@orion.oac.uci.edu (ASSIST Coordination Site) writes:
: : i am in the process of hiring 2 C++ programmers.  This Wednesday 11/18/92
: : we are cunducting the final interviews with 4 candidates.
: : 
: : I have a C++ question I would like them to address (sort of a programming
: : test, but not really) but I'm not sure if it's too simple or too complex.
: : 
: : I could also use some suggestions on what might be usefull to ask them.
: 
: Hey, interviewees... are you reading this thread?

Yes, and since you asked, I'll toss in my $.02 worth.

I, for one, would love to take a programming test as part of a job
interview.  In many cases I have lost out to less qualified individuals
because most of my C and C++ experience comes from code I wrote for
myself and friends.  While I have written plenty of non-trivial programs
(of non-trivial size and in conjunction with other programmers) I don't 
have a *company* name to put on my resume, and it has hurt me.  A 
programming test would offset this disadvantage.

As for the type of the test, I would suggest something like one of the
previous posters mentioned:

	1)	A somewhat vague assignment that needs to be 
		clarified through additional questions.  Make
		sure however that the applicant understands that
		(s)he is allowed to *ask* questions.  It might
		not even be a bad idea to have the assignment
		specify a sub-optimal algorithm, to give the
		applicant an opportunity to suggest a better
		one.  If this is done, however, the assignment
		needs to make clear that the end is more important
		than the means, i.e. even though the assignment
		*says* bubble sort, another sort is acceptable.
		
	2)	The assignment should be timed.  More accurately,
		the applicant should be asked to specify the time
		that will be required, and then held to that 
		schedule.

	3)	Another assignment to debug a piece of non-functional
		code should be given.

When the produced code is evaluated readability and robustness should
be considered as well as correctness,

--
Shawn Willden
swillden@icarus.weber.edu
From: gthkoh@ntuix.ntu.ac.sg (Koh Thong Hwee)
Newsgroups: comp.lang.c++
Subject: BC++ Container Class Problem
Date: 16 Nov 92 01:44:19 GMT
Organization: Nanyang Technological University - Singapore
X-Newsreader: TIN [version 1.1 PL6]

[ Article crossposted from comp.os.ms-windows.programmer.misc ]
[ Author was Koh Thong Hwee ]
[ Posted on Thu, 12 Nov 1992 06:36:52 GMT ]


Hi C++ gurus,

I am crossposting this question as I have gotten no reply yet from the
other newsgroups and I thought some of you might be able to help me here...
Although the question centers on BIDS template class, maybe you can still
help out by discussing on the topic of templates in general.

I would appreciate any pointers that you can offer...


TH Koh
gthkoh@ntuix.ntu.ac.sg

------------------------- attachment -----------------------------------


Hi C++ gurus,

Does anyone know of a good book that teaches how to use the Borland Container
Class, especially on the new BIDS template class.  The documentation that
comes with the BC++ 3.0 package is very poor on this for a beginner like
me.  I would like to see more examples on how to use it...

In particular, I would like to know how to use the link list to store
disparate objects.  I can use the indirect storage method of storing their
pointers instead.  However I need to declare the type T for the link list
template class and how do I declare it for storing the different pointer types
to the many different kinds of objects? 

Any help is most welcomed...


TH Koh
gthkoh@ntuix.ntu.ac.sg
Newsgroups: comp.lang.c++
From: kv07@IASTATE.EDU (Warren Vonroeschlaub)
Subject: Re: New Employee Test
Reply-To: kv07@IASTATE.EDU (Warren Vonroeschlaub)
Organization: Ministry of Silly Walks
Date: Sat, 21 Nov 1992 17:27:18 GMT

In article <641@ulogic.UUCP>, hartman@ulogic.UUCP (Richard M. Hartman) writes:
> A portfolio, by it's very nature, shows the candidate only
> at his/her best.
> 
> A "pop quiz" is a better measure of what they are capable of
> under "real world" conditions.

  I thought I would mention that, at least it in New York, it is illegal to give
a test to prospective employees before hiring them.

  We got into alot of trouble at the contracting firm when we tested prospective
employees to make sure they really knew how to use AutoCad.  A few weeks later
we found one of the people who was turned down (to be exact he knew squat,
regardless of what his resume said) complained to one of the government
agencies.

  The final result was that we had to pay a fine and would be put under
investigation if anyone else complained.

 |  __L__
-|-  ___  Warren Kurt vonRoeschlaub
 |  | o | kv07@iastate.edu
 |/ `---' Iowa State University
/|   ___  Math Department
 |  |___| 400 Carver Hall
 |  |___| Ames, IA  50011
 J  _____
Newsgroups: comp.lang.c++
From: brianm@cc.gatech.edu (Brian N. Miller)
Subject: HELP:  Trouble redefining <<
Organization: Georgia Tech College of Computing
Date: Tue, 17 Nov 1992 16:25:31 GMT

Hello, i'm working on a C++ PostScript generator.

I want to redefine the << operator for a class derived from ostream such that
it appends a ' ' after outputting any int.

BROKEN CODE   (Help me fix it...)
-----------------------------------------
class ps : private ostream {};

ps &operator<< (ps &x, int i) { return (ps&) (ps ostream::<< i << ' '); }
-----------------------------------------

Needless to say, this code is not even parsable, but i'm sure you
understand my intention.  Any suggestions?
Thanks in advance.
Newsgroups: comp.lang.c++
From: nikki@trmphrst.demon.co.uk (Nikki Locke)
From: hlf@nic.cerf.net (Howard Ferguson)
Newsgroups: comp.lang.c++
Subject: Should I use a generic object which all others inherit from
Date: 16 Nov 92 16:38:04 GMT
Organization: CERFnet

I am working on the early stages of design on an embedded C++
project. One of the decisions which we will have to make in the
near future is whether to make all of the objects inherit from 
onie generic object at the top of the tree or to go for the forest 
approach. 

I realise that the tree style will make certain  garbage collection 
methods easier, but hopefully we are going to be able to create 
everything at start-up time and never destroy them (except
for objects with scope local to one function). The only other
advantage of the generic object approach as far as I can see is
that it make hetrogenous lists easier to manage, but since all
of our type checking is gone, are we as well off using void *'s.

The NIH class library encourages the generic object approach, as
does COOL, but USL allows the forest approach. Since we have  
not decided which library of standard objects to use, that decision
will be heavily influenced by our decision on whether to go for
the tree or forest approach.

Do any of you netters have any hard-and-fast rules about when
to go for the tree and when to go for the forest aproach.
Is there a big performance price top be paid for the tree approach.
Does the tree have other advantages which I have not noted???

Bear in mind that this software must be very reliable and any
factors which effect this are very important to us. How much 
type checking are we really losing by going for a generic approach??


		Many thanks,
			hlf


Newsgroups: comp.lang.c++
From: steve@taumet.com (Steve Clamage)
Subject: Re: inline functions with static local variables (was: Re: Wisdom on f(...,const class& xxx = default_xxx))
Organization: TauMetric Corporation
Date: Mon, 23 Nov 1992 21:30:09 GMT

fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:

>steve@taumet.com (Steve Clamage) writes:

>>(because an inline function can't have static local variables).

>Why not?
>Is there any restriction on this in the ARM? I couldn't see anything
>in C++PL 2nd Ed.

>g++ will quite happily go ahead and inline such functions.

There is no explicit restriction, but there are also no defined
semantics for them.  I should have said "should not", rather than
"can't".

There is exactly one instance of any non-inline function, and exactly
one instance of a static variable in any such function.  Any invocation
of that function, from whatever source, refers to the same variable.

If you have static (non-global) functions called "foo" in each module
in a program, and each "foo" has a static variable "i", each "i"
refers to a different variable.  Calling the "foo" in module A does not
set or use the "i" in module B.

You cannot in general control or predict how many copies of an inline
function will occur in a program.  An inline function generally has
the semantics of a static function.  Is there then one copy of the
static variable per copy of the function?  The ARM does not say.
Some compilers disallow static variables in inline functions because
the semantics are undefined.  It might be treated as an error, or
by refusing to inline the function.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Vice Chair, ANSI C++ Committee, X3J16
Newsgroups: comp.lang.c++
From: greg@qualcom.qualcomm.com (Greg Noel)
Subject: Re: Can this be done with iostreams?
Organization: Qualcomm, Inc., San Diego, CA
Date: Wed, 18 Nov 1992 01:49:49 GMT

In article <1992Nov12.021415.24889@qualcomm.com> I wrote:
>Here's a fragment of code that I would like to convert to use iostreams.

I received several replies to this.  In brief, the answer is that it
can't be done as I'd hoped.

Steve Clamage suggested using sprintf to crack the parameters into a
temporary buffer, then write the buffer out.  This would work, but the
intent was to avoid using stdio at all.  Since Steve is the vice-chair
of the ANSI C++ Committee, I'm inclined to accept his pronouncement
that it can't be done the way I wanted.  (He also suggested providing
functions with just those signatures that were actually needed.  Since
this is something that will be used by a lot of different client code,
I don't think I can predict in advance all the cases needed.)

Skip Carter sent some rather amazing code that I'm still not sure I
understand.  (Can you really _do_ that?)  Anyway, it depends upon an
explicit `finisher' to indicate when the message was completed, which
is what I wanted to avoid---I wanted the `finisher' to be automatically
invoked at the end of the statement.  If it helps, I essentially want
something whose scope is a single statement, where the constructor and
destructor are invoked immediately before and after the contents of the
statement.

This is very similar to the suggestion for a `guard' construct that
just showed up in another thread.  In fact, the number of guises under
which this has shown up indicates to me that this is something that
is lacking from the language---Stuart MacMartin sent a note where
described a case where he would like to have a feature like this to
control debugging output.  And I can think of other cases where I
would like to gain control after doing a sequence of operations on
a single object.

Eventually, as I was snooping around the iostreams header looking to
see if there were any hints, I noticed that there were member functions
named `form' and `vform'.  I can't find any documentation about them,
so I suspect that they are not standard (is this the case?), but I can
suffer with them.  Obviously, they are neither type-safe nor extensible,
but I think they will get the job done well enough.

Using these functions, the code fragment becomes:
	void ReadRecords::Err(char *msg, ... )
	{
		va_list ap;
		cout << "Line " << linenumber << " of `" << filename << "': ";
		va_start(ap, msg);
		cout.vform(msg, ap) << endl;
		va_end(ap);
		++errorcount;
	}
I think ``cout << vform(msg, ap) << endl;'' would also work, but I have
not tried it.

Thanks for all the help; I appreciate it.
-- 
-- Greg Noel, Unix Guru         greg@qualcomm.com  or  greg@noel.cts.com
Newsgroups: comp.lang.c++
From: steve@taumet.com (Steve Clamage)
Subject: Re: iostreams bug in BC?
Keywords: whitespace; stream; borland; cfront; fail
Organization: TauMetric Corporation
Date: Thu, 19 Nov 1992 20:06:53 GMT

huw@siesoft.co.uk (Huw Roberts) writes:

>I have a problem with BC++ 3.1.  I'm not sure what the correct behaviour is
>so I can't tell whether or not it's a bug.  The program certainly behaves
>differently on cfront:

>    ...
>    istrstream fred (" 35    ");
>    int x;
>    fred >> x >> ws;
>    if (fred.fail())
>	cout << "You're kidding!`n";

>Borland produces the message, cfront does not.

>* Is this a bug in the Borland iostream library?

I would say it is a bug.  In this case EOF is reached while extracting
whitespace.  If this were part of "whitespace skipping" when trying
to extract something else, it would be an error, and 'fail' should
be set.  In this case, EOF is reached and nothing further has been
requested.  I believe this should not set the 'fail' bit.

>* Does anyone have a reference to an ARM equivalent for the stram library -
>  The C++ Programming Language (2nd Ed.) doesn't go into quite enough detail
>  in this area.

There is no definitive reference for iostreams.  The best documentation
currently available is the AT&T (now USL) C++ library manuals which
include iostreams.  There are some errors and omissions in the
documentation, but I don't know of a better source.  You can buy the
manuals from USL, last time I checked.

The C++ Committee is working on a definition for iostreams which will
eventually become part of the C++ Standard.  A draft of the iostream
specification was accepted by the Committee at the last meeting, but
I'm sure there will be some minor changes to it before the Standard is
ready for public review.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Vice Chair, ANSI C++ Committee, X3J16
Newsgroups: comp.lang.c++