HDTenEightyP/NetNews huggingface dataset:
From: lesher@bucknell.edu (timothy lesher `94)
Newsgroups: comp.lang.c++
Subject: Compression streams?
Date: 8 Apr 92 20:56:18 GMT
Article-I.D.: hydra.1311
Organization: Bucknell University, Lewisburg, Pa.


I just made the "Great Leap Forward" from C to C++, and I'm using C++
to write a BBS system.

I would like to know:  is there some way I can designate an istream and
ostream, so that the istream will read and decompress from a .Z file, and
the ostream will write and compress to a .Z file?  I'm not really up on
compression algorithms, so if there's some C++ library function FTPable,
please let me know.

A bit of context:  the functions will be used to read and write compressed
mail and message base files, as I have a rather low disk quota.


Tim Lesher, aka "Moskva"             |  lesher@bucknell.edu               .....
.....Perot in '92, Buchanan when hell freezes over!                       .....
....."We're kicking butt and taking initials; we're not stopping          .....
.....long enough for names!"                                              .....
From: jbn@lulea.trab.se (Johan Bengtsson)
Newsgroups: comp.lang.c++
Subject: Re: C++ Critique (3 of 4) (long)
Date: 16 Apr 92 12:06:25 GMT
Organization: Telia Research AB, Aurorum 6, 951 75 Lulea, Sweden

ian@syacus.acus.oz.au (Ian Joyner) writes:
:
: Maybe the solution is to limit a destructor in a GC scheme to very
: limited operations. Of course, if you don't have explicit 'delete',
: then where you want to close a file by deleting the file object,
: you could instead explicitly call close on the file.

I violently agree with this.  If "work" is done in destructors,
then all other operations that dependes on this "work" to be completed
must (should) also be performed in destructors.

I have been modelling transactions as automatic (local) objects that
require an explicit commit() call to actually store changes to persistent
data, like this:

voif f()
{
	Transaction t;

	PersistentObjectThatDoesWorkInDestructor rude;

	// ...
	// reads and writes, will be actually stored
	// if "t" is committed.
	// ...

	if ( someError() )
		t.abort();
	else
		t.commit();
}

It would be natural for the actual updates of persistent data
to take place inside the t.commit() function.  BUT, the "rude"
object will do some final adjustments in the destructor, _after_
t.commit().

I do realize that using a nested block would ensure that the
destructor for the "rude" object would complete before t.commit(),
but this is not fool-proof, and all programmers are fools at times.

Therefore, I have to just make a note, "toBeUpdated", and  postpone
the actual persistent update to the destructor of Transaction t!
Future classes that depend on Transactions being fully completed
will need to do some work in the destructors, and so on...

-- 
--------------------------------------------------------------------------
| Johan Bengtsson, Telia Research AB, Aurorum 6, S-951 75 Lulea, Sweden  |
| Johan.Bengtsson@lulea.trab.se; Voice:(+46)92075471; Fax:(+46)92075490  |
--------------------------------------------------------------------------
From: martin@cicada.volvo.se (Martin Borjesson)
Newsgroups: comp.lang.c++
Subject: AT&T Class Library with MPW??
Date: 10 Apr 92 19:25:39 GMT
Organization: Volvo Data AB, Dept 2592


Hello!

I have mentioned this before but didn't get any response. Maybe my
message didn't reach out...?

Anyway, have anyone successfully used AT&T Class Library on the
Apple Macintosh with MPW??? 

Regards...

/martin

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--  Martin Borjesson   --   Volvo Data AB  -- Work: (46) 31 667182 -- Coito --
-- UNIX project (2592) --  405 08 Goteborg -- Home: (46) 31 233409 --  Ergo --
--   martin@volvo.se   --      Sweden      -- Fax : (46) 31 542841 --   Sum --
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Newsgroups: comp.lang.c++
From: misawa@physics16.berkeley.edu (Shigeki Misawa)
Newsgroups: comp.lang.c++
Subject: Question about an array of a class and a subclass
Date: 7 Apr 92 18:24:44
Organization: U.C. Berkeley Physics Department
Distribution: us
Reply-To: misawa@physics.berkeley.edu
NNTP-Posting-Host: physics16.berkeley.edu


	Hi.

	I have a question about a pointer to a class and a class
derived from that class. Specifically, I have a class A and a class B,
where B is derived from A. Also, I have a class C that contains a list
of objects of class A. Suppose that when I go to implement class C, I
decide to declare a pointer, ptr to class A, i.e.

A *ptr;

and I set ptr like this:

ptr = new A [number_of_objects];


if I want the nth element of the array of objects of type A, I can do
this :

*(ptr + n - 1);


Now suppose that I want to use the same class C to store a list of
objects of class B, where B is derived from A, i.e. I want to do
something like this :

ptr = new B [number_of_objects];


If I do this, will :

*((B *)(ptr + n - 1));


"do the right thing", i.e. get me the nth object of class B. The
impression that I have is the answer to this question is no since an
object of class B may be of different size that class A. (In
particular, the pointer arithmetic will get me in trouble) 


Please email any responses.

Thanks in advance.


Shigeki Misawa
UCB Physics Department
From: kmart@athena.mit.edu (Jim Martin)
Newsgroups: comp.lang.c++
Subject: redirecting output
Date: 6 Apr 92 11:23:13 GMT
Article-I.D.: athena.1992Apr6.112313.7443
Organization: Massachusetts Institute of Technology

I have loaded a device driver in DOS to handle a second monitor.
To send output to the second monitor from the DOS prompt, I type:

	dir > MONO

(to send the output from dir to the second monitor.)

How can I redirect the output in my C++ programs to go to this
second monitor?  (I think I'm supposed to define a stream, but I don't
know how.)

Help!

Thanks.

Jim
From: doug@monet.ads.com (Doug Morgan)
Newsgroups: comp.lang.c++
Subject: Re: A really good way to do this is?
Date: 8 Apr 92 18:20:50 GMT
Article-I.D.: monet.DOUG.92Apr8102050
	<1992Apr2.051536.13054@tfs.com> <1992Apr8.004446.3033@ncsu.edu>
Organization: Advanced Decision Systems, Mountain View, CA 94043, +1 (415)
	960-7300

In article <1992Apr8.004446.3033@ncsu.edu> easchwei@eos.ncsu.edu (ERIC ARNOLD SCHWEITZ) writes:
   ...
   The problem at hand is I'd like to be able to define a general
   class which I can inherit from that has a the following property:
   each time a member function is called a hidden member function,
   eg. an access function, is called and when the member function
   exits a `deaccess' function is called.
   ...

The easiest way to do this in C++ (under UNIX) is to make an exec of a
CommonLISP process where you do the rest of your program using CLOS.
Seriously though, forget it.  (Well, maybe you could coax the
constructor of your "wrapper" class to decode all the vtable's of
derived classes, decode the stack handling of each virtual member
function pointed to in those tables, and then replace each function
pointer with a pointer to a little assembler magic that calls
access/realfunc/deaccess.  No, "forget it" is better.)

doug
/----------------------------------------------------------------------\
| Doug Morgan							       |
| Advanced Decision Systems (a division of Booz-Allen & Hamilton Inc.) |
| 1500 Plymouth St						       |
| Mountain View, CA 94043-1230					       |
| doug@ads.com, Tele: (415) 960-7300,  FAX: (415) 960-7500	       |
\----------------------------------------------------------------------/
Newsgroups: comp.lang.c++
From: usenet@wuecl.wustl.edu (Usenet Administrator)
Subject: Have you seen this book ?
Organization: Washington University, School of Engineering, St. Louis MO
Date: Tue, 14 Apr 1992 17:43:07 GMT

Hello, 

I just saw a book in my college bookstore titled, "Object Oriented
Programming with C++ and OSF/MOTIF", by Douglas young. I write
programs for a sun sparc and soon I will be using a silicon graphics
"indigo". I was wondering if any body know if this is a good book
to learn enough X so I can for example display an image or
make some not very complicated applications.... Also if the C++ code in it
is good or not ?

I would Appreciate any comments.
+-------------------------------------------------+-----------------------+
|Abed M. Hammoud (KB0INX)			  | abed@saturn.wustl.edu |
|Washington University.				  | Office:               |
|Electronic Systems & Signals Research Laboratory.| -Voice:(314) 935-7547 |
|Department of Electrical/Biomedical Engineering. | -FAX:  (314) 935-4842 |
|Campus Box 1161, One Brookings Drive.		  |			  |
|St. Louis, MO , 63130 USA			  |                       |
+-------------------------------------------------+-----------------------+
From: jbn@lulea.trab.se (Johan Bengtsson)
Newsgroups: comp.lang.c++
Subject: Re: Call by reference using * and &
Date: 15 Apr 92 16:09:04 GMT
Organization: Telia Research AB, Aurorum 6, 951 75 Lulea, Sweden

rmartin@willing.Rational.COM (Bob Martin) writes:
: lam@saifr00.cfsat.honeywell.com (Josh Lam) writes:
: 
: >In C++, call by reference can be accomplished using pointers (like in C) or
: >by reference (&).  Question:  What are some advantages of using references
: >over pointers (or vice versa)
: 
: Secondly, the forms:
: 	
: 	void f(TYPE*);
: 	void f(TYPE&);
: 
: [...] The reference form
: *guarantees* that a real object is being refered to.

	Too strong wording.  The reference _should_ guarantee
	that there is a real object.  In practise it just might be
	(a reference to) a dereferenced null pointer:

	TYPE* p = h();	// h() happens to return a null pointer
	f(*p);		// oops, no real object after all

	One might argue that a good compiler should detect this,
	however I am aware of none (is there such a compiler?).

: When the pointer form is used, the called function should always
: assume that the argument can be zero.  When using the reference form,
: the called function should never check for zero.

	In theory, yes.  In practise, an assertion may be appropriate:

	void f(const TYPE& t)
	{
		assert( &t != 0 );
		// ...
	}

-- 
--------------------------------------------------------------------------
| Johan Bengtsson, Telia Research AB, Aurorum 6, S-951 75 Lulea, Sweden  |
| Johan.Bengtsson@lulea.trab.se; Voice:(+46)92075471; Fax:(+46)92075490  |
--------------------------------------------------------------------------
Xref: sparky comp.lang.c++:6844 comp.windows.ms.programmer:5508
From: zirk@keba.co.at (h. zirknitzer)
Newsgroups: comp.lang.c++,comp.windows.ms.programmer
Subject: Need Info about Application Frameworks
Date: 16 Apr 92 14:26:02 GMT
Organization: KEBA Elektronikbau, Linz, Austria, Europe

hi folks out there,

I am looking for OO - developement tools (C++) and an application framework
for Windows 3.1 (NT).

These tools have to provide me with a compiler, editor, debugger,
inspector (run-time infos about objects), class-/hierachy-/structure-
browser, whereas an application framework should support me with
meta informations, undo/redo mechanism, collection classes, dbms-
interface, MDI and an interface builder.

Ok, I know I can have this under an X-environment (e.g. ET++), but 
can I trust Microsoft's MSC 7.0 announcment: "..Take application 
frameworks.  You'll see that our's (MFC) are more useful. And they have 
more what you really need. Including OLE and GDI."

Unfortunately MSC 7.0 is not yet available here and I urgently have to 
make a decision about our develop.environment.

Can MSC 7.0 satisfy my requirements or are there other products out there,
maybe platform independent (and I don't mean Common View). 

Thanks a lot for every information I receive,

servus herman

-- 
Hermann Zirknitzer		   email: zirk@keba.co.at
c/o KEBA, Gewerbehof C             phone: (++43 732) 230911-94
A-4041 Linz, Austria, Europe       fax:   (++43 732) 230910
Newsgroups: comp.lang.c++
From: pete@borland.com (Pete Becker)
Subject: Re: Need more help, PLEASE, PLEASE, PLEASE!!!!
Organization: Borland International
Date: Thu, 16 Apr 1992 21:46:02 GMT

In article <zmaHp=es6@cs.psu.edu> plambert@sml.cs.psu.edu (Paul  Lambert) writes:
>HELP again!
>
>I know I've been pestering a lot of people, but _NONE_ of the advice I've been
>given seems to work.  I'm pretty sure I'm not just being stupid--though it is
>a distinct possibility :-).
>

	Here's a simplification of the problem referred to:

	class Base
	{
	virtual void foo( Base& ) = 0;
	};

	class Derived : public Base
	{
	virtual void foo( Derived& );
	};

	The compiler is right to complain when you try to create an instance of
class Derived.  The foo() in Derived does _not_ override the foo() in Base,
because it has a different argument list.  The derived class must provide a
function foo() which takes a Base&.
	-- Pete
From: bright@nazgul.UUCP (Walter Bright)
Newsgroups: comp.lang.c++
Subject: Re: Can any MSDOS C compiler handle big files?
Date: 11 Apr 92 21:19:12 GMT
Reply-To: bright@nazgul.UUCP (Walter Bright)
Organization: Zortech, Seattle

In article <1992Apr10.043730.26451@m.cs.uiuc.edu> jyelon@dante.cs.uiuc.edu (Josh Yelon) writes:
/Is there any MSDOS C compiler that doesn't say "error: code segment
/too large" when you give it a big source file? 
/This is absurd behavior for a compiler. Code segments and other
/machine-specific details are the compiler's job --- That's what I use
/a compiler for! "Code segment too large" is nothing but a glorified
/compiler bug.

One of the consequences of C being close to the machine is that not only
do you pick up performance, but you pick up the machine limitations.
If you are compiling for a 16 bit target, you are simply going to have
problems with various 64Kb limitations. To make that go away,
o	Use a higher level language than C.
o	Use a 32 bit target (possible under DOS with some compilers)
Newsgroups: comp.lang.c++
From: jimad@microsoft.com (Jim ADCOCK)
Subject: Re: Borland C++ 3.0 Linker error - Fatal Table Limit Exceeded
Date: 13 Apr 92 19:04:25 GMT
Organization: Microsoft Corp.

In article <1992Apr8.145036.12217@tfs.com> eric@tfs.com (Eric Smith) writes:
|In article <1992Apr07.182510.16961@microsoft.com> jimad@microsoft.com (Jim ADCOCK) writes:
|>choice of compiler than either Borland or Microsoft.  Take some time
|>to learn the different products, libraries, debuggers, etc, lest you make
|
|I have found that those C++ compilers that are limited to 640K are not
|very useful for real work.  I don't know if Microsoft has that limit,
|but in the past I stopped using an earlier version of Borland because
|it became a problem.

If you were to evaluate the C7 compiler as suggested, rather than speculate 
about it, you would find out that not only does it not have a 640K limitation, 
but it also doesn't have many of the other compilation limits found in other 
C++ compilers -- be they running under whatever operating system.

The reason I suggest people actually evaluate the actual compilers is because
there seems to be no other way for C++ programmers to get reliable unbiased 
information about them.  Which is unfortunate.  Perhaps some day there will
be careful, reliable, intelligent, independent evaluations available to
C++ programmers -- I look forward to such a day.

Newsgroups: comp.lang.c++,comp.windows.ms.programmer,comp.os.msdos.programmer
From: sidney@borland.com (Sidney Markowitz)
Subject: TDW and Windows 3.1 (was Re: Please Help: TDWIN31)
Organization: Borland International
Date: Tue, 14 Apr 1992 03:40:48 GMT

In article <1163@datmuc.UUCP> klm@datmuc.UUCP (Klaus Maehringer) writes:
>Some days ago, in this newsgroup was posted, how to receive the Windows 3.1
>compatibility file for BC++ 3.0.
>Unfortunately, I had no success with my simtel20-request!

I made a couple of mistakes in my earlier postings. First, TI868.ZIP
turned out to simply be an announcement that Borland will be coming
out with BC++ and TP update kits for Windows 3.1 and to use these
other files in the meantime, so I am not uploading it. Second, I said
the wrong directories. So here's the correct information.

TPWN31.ZIP is for Turbo Pascal for Windows programmers, and contains
the DLL for TDW and a bunch of Pascal units for OLE and such.

TDWIN31.ZIP is for non-TP users of Turbo Debugger for Windows.

TDWIN31.ZIP and TPWN31.ZIP can now be obtained by anonymous ftp from:

wsmr-simtel20.army.mil in pd:<msdos.borland>
wuarchive.wustl.edu    in mirrors/msdos/borland
oak.oakland.edu        in pub/msdos/borland

or can be ordered by e-mail from listserv@vm1.nodak.edu or from
listserv@ecs.rpi.edu (on BITNET use LISTSERV@NDSUVM1 or
LISTSERV@RPIECS) by sending a message like:

/pdget mail pd:<msdos.borland>tdwin31.zip uuencode

You can also specify xxencode instead of uuencode to avoid character
translation problems if you have a copy of xxdecode. You can get
that in pd<msdos.starter>xxdecode.txt which is an ASCII script for
debug and so can be retrieved in plain text form (just don't say
anything in the last field of the /pdget request).

 -- sidney markowitz <sidney@borland.com>
Newsgroups: comp.lang.c++
Subject: exception handling in C++
From: psyxsgp@otago.ac.nz
Date: 15 Apr 92 19:45:03 +1300
Organization: University of Otago, Dunedin, New Zealand

	What is the current status of exception handling .. and
in particular system error exception handling in C++?
	I believe that this issue was due to be resolved recently but have not
seen anything.
	Also .. does GCC ver 2.x support any form of exception handling?
 
-- 
Stephen Pearce, University of Otago, Dunedin, New Zealand.
ph 064-3-7470999 ext 8166 home 064-3-4763778
From: ric@updike.sri.com (Richard Steinberger)
Newsgroups: comp.lang.c++
Subject: implementing [][] for a 2-D array
Date: 14 Apr 92 19:01:48 GMT
Organization: sri
Originator: ric@updike


	I am trying to create a 2-D array that does bounds checks and
allows double indexing.  So far the class looks like:

class array_2
{
  private:
    int rows;
    int cols;
    int ** iptr;
  public:
    .
    .
    int * & operator[](int);
    .
};

I would like to be able to use double subscript notation (i.e., a[2][5])
and bounds check both indices.  How do people generally do this?  I am
considering using a nested class that would have an operator[](int) to deal
with the int* returned from the above operator[] function.  Are they better,
more elegant approaches that still allow bounds checks on both indices?  All
the examples I've seen on bounds checking use 1-D arrays.  Thanks in advance
for any suggestions.

ric steinberger
ric@updike.sri.com
Newsgroups: comp.lang.c++
From: allan@stasys.UUCP (Allan Brighton)
Newsgroups: comp.lang.c++
Subject: Re: Overlays
Date: 15 Apr 92 19:54:37 GMT
Organization: Contract Software Engineer, Munich Germany


I know you can get the Interviews, g++ and NIHCL libraries from the
Prime Time Freeware CD or the GNU/X11 CD, but does anyone know if
you can get any of the libraries listed below or other C++ sources on
CD somewhere ?

(I don't currently have access to ftp...)


Name: OATH (Object-oriented Abstract Type Hierarchy)
Name: COOL (C++ Object-Oriented Library)
Name: ET++
Name: Classix
Name: Linpack.h++
Name: Matrix.h++
Name: LEDA
Name: USL (UNIX System Laboratories Europe Ltd.)
Name: Rational
Name: Booch Components
Name: Open Dialogue
Name: Zinc Interface Library (Iconic user interface)
Name: C++/Views (Iconic user interface)
Name: ICpak101
Name: ICpak201
Name: CommonView (Iconic user interface)
Name: Analyst (Information Centre)
Name: Humble  (Expert system package)

Thanks in advance...
Newsgroups: comp.lang.c++
From: melissag@iplmail.orl.mmc.com (Melissa Garber)
Subject: g++ compiler 
Organization: Martin Marietta
Date: Fri, 10 Apr 1992 14:15:52 GMT

I'm having trouble compiling a simple program with a call to 'getch'.
I include 'curses.h', and link with the 'curses' library.
The program compiles, but croaks out a 'Segmentation Fault' when it is run.
Got any ideas?

*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*

Melissa Garber                               Image Processing Lab
melissa-garber@orl.mmc.com                   Martin Marietta Electronic Systems
Phone: (407) 356-8745                        Orlando, Florida
Fax:   (407) 356-8944

 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
From: sabg9174@uxa.cso.uiuc.edu (Tolthrye)
Newsgroups: comp.lang.c++
Subject: ?? dynam. arrays of ptrs to structs..HELP!
Summary: How do I declare and implement this?
Keywords: dynamic array structure
Date: 14 Apr 92 21:05:50 GMT
Article-I.D.: ux1.1992Apr14.210550.22631
Organization: University of Illinois at Urbana

HELP! I'm trying to set up a dynamic array of ptrs to
structures.

The structures are themselves elements of a bidirectional
linked list, and are declared in a header file via

      typedef struct
      {
	 struct MY_STRUCT *pointer_back;
	 struct MY_STRUCT *pointer_ahead;
	 int list_entry;
       }MY_STRUCT;


I have tried the following sorts of declarations in a header file:

(1)   extern MY_STRUCT *(*array_name)[];

which I think creates a pointer, called array_name, to an array
of pointers to structures of type MY_STRUCT.

The problem occurs when I try to use new to reserve memory for
this array.  Specifically, I am trying to initialize these
array with something like

      array_name = new *MY_STRUCT[size];
      array_name = new (*MY_STRUCT)[size];
      array_name = new MY_STRUCT*[size];

but receive an error msg from the compiler (Zortech's shareware
c++ compiler).  

Could someone help me out here? Is (1) the correct way to begin,
and how do I then use new to set up the arrays?  Also, any advice
on the syntax of initializing the values of the first element of
the lists would be appreciated.

Thanks.



..............................................................................
:                                     :                                      :
:  sbrown@symcom.math.uiuc.edu        :  sabg9174@uxa.cso.uiuc.edu           :
:                                     :                                      :
..............................................................................
------------------------------------------------------------------------------

	"The aim of proof is, in fact, not merely to place the truth of a
proposition beyond all doubt, but also to afford us insight into the
dependence of truths upon one another."
					-Gottlob Frege

	"Jane, how do I stop this crazy thing!?!?!"
					-George Jetson




------------------------------------------------------------------------------
Newsgroups: comp.lang.c++
From: wolf@merlin.mt.att.com (Thomas Wolf)
Subject: testing again (please ignore)
Organization: AT&T Bell Laboratories
Distribution: att
Date: Wed, 15 Apr 1992 13:59:54 GMT

more testing of my xrn program. Please ignore.
tom
From: doug@monet.ads.com (Doug Morgan)
Newsgroups: comp.lang.c++
Subject: Re: Call by reference using * and &
Date: 15 Apr 92 17:24:26 GMT
Article-I.D.: monet.DOUG.92Apr15092426
	<rmartin.703296361@willing>
Followup-To: comp.lang.c++
Organization: Advanced Decision Systems, Mountain View, CA 94043, +1 (415)
	960-7300

In article <rmartin.703296361@willing> rmartin@willing.Rational.COM (Bob Martin) writes:
   ...
   Secondly, the forms:

	   void f(TYPE*);
	   void f(TYPE&);

   are not semantically equivalent.  They both represent the
   pass-by-value paradigm, but the pointer form allows the argument to be
   zero, whereas the reference form does not.  The reference form
   *guarantees* that a real object is being refered to.
   ^^^^^^^^^^^^
   ...
   +---Robert C. Martin---+-RRR---CCC-M-----M-| R.C.M. Consulting         |

If the ARM doesn't disallow:

void f(TYPE&);
main() {
  f(*(TYPE *)0);
}

, "*guarantee*" might be a bit strong.  "Suggests under most
reasonable conditions" might be more appropriate.

doug