HDTenEightyP/NetNews huggingface dataset:
From: bright@nazgul.UUCP (Walter Bright)
Newsgroups: comp.lang.c++
Subject: Re: oopslooking for PerClass/SizeFreeList, oops
Date: 10 Jan 93 01:08:23 GMT
Reply-To: bright@nazgul.UUCP (Walter Bright)
Organization: Zortech, Seattle

In article <1993Jan7.000515.11405@umr.edu> S103408@UMRVMB.umr.edu writes:
/Ok, BC++3.1 isn't working due to > 64K code segment.
/Anybody out there have any experience with:
/MetaWare High C++
/Zortech C++
/Watcom 9.0 C++

	I'll answer for Zortech C++.

/that can tell me if these can do 32bit flat memory model coding
/with dos and a dos-extender?  Can I malloc() objects > 64K ?

	Yes and yes. No far or huge pointers, either.

/Are there outrageous liscensing restrictions on the generated code?

	None at all (i.e. you can distribute/resell dos extender
	executables without any payment or permission from Symantec).
	You can't, of course, redistribute the development system!

/Can I link in the extender or does it have to be already running?

	The extender links in and looks to the end user like just another
	DOS app. No device driver is required. It does not require
	Windows or 386MAX or QEMM to be running. It only requires a
	386 or better. It doesn't even require more than 1Mb of memory
	to run...

	To build a simple 32 bit DOS extender app out of "hello world":

		ZTC -mx HELLO

	The only caveat is we don't ship a debugger for it (i.e. debug
	in a 16 bit model, and recompile for DOSX). Yes, I know this
	is suboptimal :-)
Newsgroups: comp.lang.c++
From: marc@meadow.uucp (Marc Riehm)
Subject: Re: Survey: File Extension
Reply-To: marc@meadow.UUCP (Marc Riehm)
Organization: Amdahl Canada Ltd., Software Development Center
Date: Wed, 6 Jan 93 13:11:06 GMT

In article <24394@alice.att.com> bs@alice.att.com (Bjarne Stroustrup) writes:
>
>erc@netcom.com (Eric Smith @ Netcom) conjectures:
>
> > I think ... the name
> > C++ wasn't originally intended to be pronounced "see plus plus", as the
> > ++ operator was originally called the increment operator, and a lot of
> > C programmers considered people who called it "plus plus" to be
> > uneducated.  But that has gradually changed over the years, and now the
> > majority calls C++ "see plus plus" 
>
>C++ was always pronounced C plus plus.

Yeah? And what makes _you_ so sure?  :)
-- 
Marc Riehm      Amdahl Canada Ltd., Software Development Center
                2000 Argentia Road, Plaza 2, Suite 300
                Mississauga, Ont.   L5N 1V8
marc@meadow.UUCP
Newsgroups: comp.lang.c++
From: johnston@ug.cs.dal.ca (geoff)
Subject: Calling C++ functions from C
Organization: Math, Stats & CS, Dalhousie University, Halifax, NS, Canada
Date: Fri, 8 Jan 1993 21:47:24 GMT


I have run into a problem calling C++ functions from C.
Currently I am using the 'extern "C"' method to avoid mangling
the C++ function which is to be included in a library to be called by
a C program.

So what I am doing now (which fails at run-time with a bus error)
is:
compile the C++ function into an object file
create an archive library with 'ar' from that object file
compile the calling C program with both the above library and libC.a

I have been able to easily call C from C++ and C++ from C++
using this kind of approach.  But this runtime error puzzles me.

Advice from anyone who has worked with calling C++ from C would
be appreciated (unix).  I profusely apologize for any editing
screwups / other assorted infractions: I'm on a *very* slow telnet link.

-Geoff Johnston

Newsgroups: comp.lang.c++
From: oper7@ee05.ncu.edu.tw (Anthony Shih Hao Lee)
Subject: TVISION:cmQuit and clearEvent :(
Organization: Dep. of EECS, National Central University, Chungli, Taiwan, R.O.C.
Date: Sat, 9 Jan 1993 10:03:50 GMT

Hi, the programmers of TVISION:
I recently use TVISION, but find it has a very strange behavior
while I quit my TV app, TApplication seems not to destroy all
other objects which has created for my application.
I must actively to broadcast cmQuit message to those windows
which has exposed on the desktop, so that they could finish their job.
1.
in fact, TApplication should broadcast some useful message such as
cmClose, cmQuit to announce windows on the desktop.
and, cmQuit message for a TApplication seems not similar to other
evCommand.
2.
Due to cmQuit is the most important message which all
handleEvent should take response, user's TApplication::handleEvent
could not use clearEvent, and must pass this message to it's parent
handleEvent. am I wrong?

and because other type of classes do not handle this message, so if
I post cmQuit to a TWindow, It must do clearEvent, so that I know
that TWindow is properly dispose all things it occupied.

if you can enlight me, please directly e-mail to me, thanks anyway.
tony
-- 
>>> Anthony Li <Li3, Shih4 Hao2><Li:fruit's Name><Shih:Scholar><Hao:Hero>   <<<
<<< Institute of CSEE, National Central Univ, Chungli, Taoyuan, Taiwan, ROC >>>
>>> Internet:	oper7@mbox.ee.ncu.edu.tw	 oper2@ncuee.ncu.edu.tw	    >>>
Newsgroups: comp.lang.c++
From: hclam@cuse1.se.cuhk.hk (LAM Ho Cheong)
Subject: standard ?
Organization: Faculty of Engineering, The Chinese U. of Hong Kong
Date: Thu, 7 Jan 1993 07:29:07 GMT

   I'm sorry if this is a FAQ.  I want to know whether there is
   a standard text book for C++ language, just like the ANSI for
   C language?  I found a book called "Programming In C++" by 
   Stephen C. Dewhurst and Kathy T. Stark, Prentice Hall.  The
   book is quite well-organized.  Would you kindly send me the
   name of such book via hclam@se.cuhk.hk if you have any 
   favorite.

   Thanks a lot!

HC
From: tornick@gdc.com (Ed Tornick)
Newsgroups: comp.lang.c++
Subject: C++ and Motif application builders.
Date: 11 Jan 93 14:20:12 GMT
Reply-To: tornick@gdc.com
Organization: General DataComm, Middlebury CT

A group of us recently developed a prototype system that used OpenLook and
DevGuide on the SUN.

Although DevGuide helped us build the actual windows, we needed a way to manage
the windows and their interactions. To this end we developed a C++ class which handled the details of this management. Each window that we build would then inherit this
base class. The base class managed creation of multiple instances of a given window,
stored ptrs to the children windows, handled the destruction of children windows, etc.

We are now building a prototype using C++ and Motif. Rather than re-write the
OpenLook code that managed the windows we are looking for a package (either public
domain) or commercial that we can use to manage the window architecture.

We are using Xdesigner for the actual contruction of the individual windows.

Any information would be appreciated.

Thanks.
Newsgroups: comp.lang.c++
Subject: Good C++ book for teaching ?
From: kodagali@wsuhub.uc.twsu.edu
Date: 12 Jan 93 15:51:36 CST
Organization: Wichita State University, Wichita, Ks

Hi netters,
  I am going to teach C++ in summer (June) for an
undergraduate class and am thinking of using the
Borland C++ (Windows) compiler. (Students in the
class are required to know C beforehand.)

  Any suggestions for a readable book with lots 
of examples and which covers major concepts ?

  Thanks a lot in advance.

Sampada.
Newsgroups: comp.lang.c++
From: dwr@cci632.cci.com (Donald W. Rouse II)
Subject: Re: Not supposed to use static variables in member fns?
Organization: [Computer Consoles, Inc., Rochester, NY
Date: Tue, 12 Jan 1993 17:43:24 GMT

In article <1993Jan1.153855.26566@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
>In article <ghawkins.725838896@unix1.tcd.ie> ghawkins@unix1.tcd.ie (George C. Hawkins) writes:
>>
>>If a member function wants to remember a value between calls to it
>>then it must store that value in a varaible visible to all member
>>functions. [...]
> [...]
>	You can solve your problem with several techniques,
>one being to make the function a member of yet another class,
>and put a pointer to it in the original object:
>
>// Originally
>
>	class X { int dontcare; int private_to_f; 
>		f(){  ... private_to_f .. }
>		g(){ .. private_to_f .. } // WOOPS
>	};
>
>// fixed
>
>	class X { int dontcare; Y* y;
>		g(){ cant access 'private_to_f'}
>		f(){y->f();}
>	};
>
>	class Y {int private_to_f; 
>		public: f(){ .. private_to_f .. } };
>
>// Ugly, requires pointer :-(

Why?  Why can't you have:

	class Y {int private_to_f; 
		public: f(){ .. private_to_f .. } };

	class X { int dontcare; Y y;
		g(){ cant access 'private_to_f'}
		f(){y.f();}
	};
Newsgroups: comp.lang.c++
From: dougw@grebyn.com (Doug Worthington)
Subject: What is wrong with this, a simple question 
Organization: Grebyn Timesharing
Date: Tue, 12 Jan 1993 00:32:46 GMT

Here is a snipt of code, why doesn't this work

.h file
----------
class foobar
....
public:
	char operator [] (int index);
....

.cc file
-----------
....
char foobar::operator [] (int index)
{
	.....
}

source file This example works.
-----------

	foobar fooBarThing();

	cout << fooBarThing[1];

source file This example DOESN'T work
---------
	
	foobar *fooBarThing();
/* allocat the foobar object */

	count << fooBarThing[1];

Why does declaring the objecty as a pointer change the use of the index
member function.  The [] operater function isn't even called in the
second example.

Thanks for the help

dougw
dougw@grebyn.com

P.S.  please respond to me and not the net if you can.

	









Newsgroups: comp.lang.c++
From: nikki@trmphrst.demon.co.uk (Nikki Locke)
Subject: Re: Passing 2-d arrys to functions
Reply-To: nikki@trmphrst.demon.co.uk
Distribution: world
X-Mailer: cppnews $Revision: 1.30 $
Organization: Trumphurst Ltd.
Date: Fri, 8 Jan 1993 12:26:28 +0000

In article <C0Hw4n.Hy9@knot.ccs.queensu.ca> liu@vision(John Liu) writes:
> I am trying to learn C++ and have a problem in passing a 2-d matrix to and 
>    from a function. Specifically, the problem is as follows:
> 
>    main()
>    {
>    double a[2][2];
>    ......
>    func(a);
>    }
> 
>    void func(double b[][]){
>    ......
>    }
> 
>    When I tried to compile it, I got error message that the dimension of the matrix 
>    b is null. However, I did not have any problem in passing any 1-d array
>    using the same way. I am working on SUN stations in our department.

In C (and C++), an array is passed to a function as the address of its 
first element. Not other information (like the size of the array) is 
passed.

For a single-dimension array, this is fine - all the compiler needs to 
know to access the n'th element is the address of the first element, and 
the size of each element (which it can deduce from the type). The 
calculation is simply (n * sizeof(element)).

For a two (or more) dimensional array, to access element [m][n], the 
compiler needs to know the address of the first element, the size of each 
element, and the number of elements in the least significant dimension. 
The calculation for an array declared [DIM1][DIM2] is 
((m * DIM2 + n) * sizeof(element)).

Thus, when declaring the array function parameter, all but the most 
significant (left-most) dimension must be specified at compile time.

In your example, you need ...
>    void func(double b[][2]){
>    ......
>    }

There is nothing to stop you doing ...
>    void func(double b[2][2]){
>    ......
>    }
if you wish.

The confusion between pointers and arrays in C (and C++) is one of the 
tricky bits. Fervent C++ purists have even been know to say that array
handling in C++ is completely broken (because it is like that in C), and
should rarely be used. 

You might well find it useful to obtain the FAQ list for C and C++. I 
don't know where the C one is to be found, but the C++ one can be obtained ...

Via ftp - Anonymous ftp from sun.soe.clarkson.edu [128.153.12.3] :pub/C++/FAQ

Via mail - send mail 
To: archive-server@sun.soe.clarkson.edu
Subject: send C++/FAQ

Many thanks to Marshall Cline for compiling and maintaining it. 
-- 
Nikki Locke,Trumphurst Ltd.(PC and Unix consultancy) nikki@trmphrst.demon.co.uk
trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
From: jegm@cody.esd.sgi.com (Jim Morris)
Newsgroups: comp.lang.c++
Subject: Re: Borland C++ & AppFW CD-ROM
Date: 6 Jan 1993 23:27:35 GMT
Organization: Silicon Graphics, Inc.
Distribution: world
Reply-To: jegm@esd.sgi.com
NNTP-Posting-Host: cody.esd.sgi.com

In article <1993Jan5.230958.23053@serval.net.wsu.edu>, rnelson@wsuaix.csc.wsu.edu (roger nelson;S23487) writes:
|> 
|> Does anybody have  the Borland C++ & Application Framework 3.1 CD-ROM?
|> 
|> I would like to know if this still has to be installed on the hard disk
|> or can it be run off the CD-ROM?
|> 
|> Thanks,
|> 
|> Roger Nelson

It can be run from the CD or installed on the HD, or anything inbetween.
I just installed the bare minimum, and use the cd if I want access to the examples or source code.
-- 
Jim Morris, Email: jegm@esd.sgi.com  Voice: (415) 390-5136
Newsgroups: comp.lang.c++
From: dturner@email.bony.com (Doug Turner)
Subject: Re: A Fine Beginner's Book on C++
Organization: ***
Date: 11 Jan 93 00:00:23 EST

In article <1993Jan10.095324.9821@alchemy.chem.utoronto.ca>, mbersohn@alchemy.chem.utoronto.ca (M. Bersohn) writes:
> As the best beginner's book on C++ for somebody who knows C I
> recommend TEACH YOURSELF C++ by Herbert Schildt, published by Osborne
> McGraw Hill  ISBN 0-07-881760-9 
> It is only a primer. There is no depth and it lacks detail; for
> example templates are not mentioned. BUT, there is a superb
> wealth of practice examples with answers and frequent quizzes
> with answers. The progression is quite gradual. This book is
> a highly efficient way to get started with C++, provided you
> know C. Incidentally this book is not mentioned in the FAQ.
There is no arguing taste...this book covers the syntax, but it really 
does not show you how to teach you to use C++ effectively.  If you just 
want to learn the syntax, then why not stick to Stroustrup's manual 
(which, of course, goes much further than just the syntax)?  I think the 
examples are often silly and repetitive, and the books shallowness (I 
couldn't find one example of the use of composition, for example) makes 
it pretty worthless for someone without an OOP background.  I would 
consider this about the worst such beginner's book I have seen.
Doug Turner
Standard disclaimer
dturner@email.bny.com
From: udparmet@mcs.drexel.edu (Daniel J. Parmet)
Newsgroups: comp.lang.c++
Subject: Re: Saving objects to files
Keywords: OO database, file
Date: 11 Jan 93 14:25:05 GMT
Organization: Drexel University

In article <1fkfcoINNco3@agate.berkeley.edu> jkelly@violet.berkeley.edu 
(John Kelly;Extension MIS Office;36219;;LN41) writes:
>>	I need to save a list (array) of *objects* to a file, so's that
>>	I can load them back later. The objects describe various
>>	different graphics (squares, circles, triangles etc) and aren't
>>	guaranteed to have the same superclass.
>>
>>	Is there a convenient way (ie function call etc) with which the
>>	above could be implemented?
>
>I have a similar problem, and it seems books on C++ and OOP are
>a little shy about bringing up the topic. Any suggestions you send
>to Titch, please copy to me--many thanks.

I seem to recall that certain C++ compilers allow for the keyword *persistent*
before an object declaration.  This tells the system to save the object to
a file upon program termination and to automatically read it back in when the
program is run again.  (Essentially, it implements an object-oriented 
database.)  I don't know much more about it and would be interested in more
information if anyone has any.

Thanks.

-- 
********************************************************************************
*                  Daniel J. Parmet (udparmet@mcs.drexel.edu)                  *
*                   "If it's too loud, then you're too old!"                   *
********************************************************************************
Newsgroups: comp.lang.c++
From: nikki@trmphrst.demon.co.uk (Nikki Locke)
Subject: Re: How to prevent local instances, but allow "new"
Reply-To: nikki@trmphrst.demon.co.uk
Distribution: world
X-Mailer: cppnews $Revision: 1.30 $
Organization: Trumphurst Ltd.
Date: Wed, 6 Jan 1993 12:22:34 +0000

In article <1icij0INNdhc@news.cerf.net> hlf@nic.cerf.net (Howard Ferguson) writes:
> I wish to define a class in a library which the library user
> can create by dynamic allocation via the new operator, but
> I want to prevent him from creating automic instances.

Leave the constructors public. Make the DESTRUCTOR private. Provide an
inline member function ... 

	void destroy() { delete this; }

Users have to call destroy instead of delete, but they won't be able to
create automatic, static or extern objects of the class.

-- 
Nikki Locke,Trumphurst Ltd.(PC and Unix consultancy) nikki@trmphrst.demon.co.uk
trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
Newsgroups: comp.lang.c++
From: miller@isrc.sandia.gov (Dave Miller)
Subject: Calling C++ from C ... again
Organization: Sandia National Labs, Org. 1600, Albq., NM
Date: Mon, 4 Jan 1993 23:55:02 GMT

I know this has been asked a million times, but I can't find my FAQ files
anywhere.  I would appreciate it if someone could email me any or all
solutions previously posted about how to call C++ class methods from
a C program.

Thanks in advance

Dave Miller
miller@isrc.sandia.gov

Newsgroups: comp.lang.c++
From: Heliotis.ROCH803@xerox.com (Jim Heliotis)
Subject: Re: Not supposed to use static variables in me
Reply-To: Heliotis.ROCH803@xerox.com
Organization: Xerox Corporation, Webster NY
Date: Tue, 5 Jan 1993 14:37:23 GMT

In article 725838896@unix1.tcd.ie, ghawkins@unix1.tcd.ie (George C. Hawkins) writes:
>
>If a member function wants to remember a value between calls to it
>then it must store that value in a varaible visible to all member
>functions. Is this right? I was doing:
>
>class Foo {
>	void bar;
>}
>
>void Foo::bar()
>{
>	static int remember;
>
>	// etc.
>}
>
>But was rather upset to find that all instances of Foo shared the
>same 'remember'.


I have not yet seen the answer to this question that I consider most
straightforward.  You should declare "remember" as a member variable
(non-static).  The only disadvantage to that, possibly, is that any
member function can access it that way.


============================================================================
Jim Heliotis                                       Voice Phone: 716-383-7410
Xerox Corporation                                   FAX Phone:  716-383-7395
435 W. Commercial St.                                     Mail Stop: 803-01A
East Rochester, NY 14445              Electronic Mail: JEH.ROCH803@Xerox.COM
============================================================================


Newsgroups: comp.lang.c++,comp.object
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Subject: Re: Pros and cons of C++
Organization: MAXTAL P/L C/- University Computing Centre, Sydney
Date: Tue, 12 Jan 1993 17:14:17 GMT

In article <MUTS.93Jan12115352@PMCS.estec.esa.nl> muts@estec.esa.nl (Peter Mutsaers) writes:
>
>Until now I had the idea that C++ does not enforce the OO paradigm
>fully, but still it allows you to do if you want (except that the
>basic types are a bit special cases, but that's not important). If I
>am wrong, could you tell why C++ cannot do this?

	You have to say what you think the OO paradigm actually *is*
first :-)

	Some would claim that not having garbage collection
was a major impediment, for example.

	Others might cite the lack of dynamic message handling.

	I for one prefer to say C++ is class oriented, not object
oriented. 
-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
Newsgroups: comp.lang.c++
From: bsjaffe@icd.ab.com (Bruce S. Jaffe)
Subject: Dynamic Dispatch Virtual Tables
Organization: Allen-Bradley Company, Inc.
Date: Tue, 12 Jan 1993 16:06:02 GMT

A recent posting by Leo Lozner (leo@minsk.by) referenced the article
"The Dynamic Dispatch Virtual Tables", published in the May '92 issue
(vol 6 num 5) of ProgramNOW (Intra Press, London -- prognow@compulink
.co.uk).

I have not been able to locate a copy of this article, or to contact
either Leo or ProgramNOW.

Does anyone have a copy of this article which they could mail to me?

Alternatively, does anyone know how to reach ProgramNOW?

Please respond by email to bsjaffe@odin.icd.ab.com.

Thanks.

Keywords: 

Newsgroups: comp.lang.c++
From: pault@dayfac.cdc.com (Paul Thompson;DAYFAC-ITS;)
Subject: Restatement and clarification of "static inheritance" question
Summary: looking for help to inherit functionality
Keywords: inheritance
Organization: Control Data Corporation, Dayton, Ohio
Date: Fri, 8 Jan 93 15:44:46 GMT

First off, thanks to all those who responded to my question and my
apologies for not being clear. I probably should have chosen a different
phrasing of the problem and certainly should have explained it better!
First to answer the replies received so far and I will clarify.
 
rweaver@otc.otca.oz.au
>How does this variation, on your theme, strike you?
>It seems to me, to work as you wished.  
ANSWER:see "desired output" below
 
uunet.UU.NET!uunet!segfault!rfg (Ron Guilmette)
>Could you please tell me which compiler you are using, 
> and why you think it does not cause static data members 
> to be inherited?
ANSWER 1.Borland C++ v2.0
       2.Sorry I wasn't clear. I want to inherit the FUNCTIONALITY
         of A, not (necesarily) its data member. See desired output
         below.
 
bradav%udcps3@bradav.Auto-trol.COM (Brad Davidson)
>My question would be does class B and Class C initailize class A?
>In that class B : public A {B() : A() {} }
>will get the desired effect.
ANSWER Sorry, I don't understand. Could you elaborate ?
 
 
          
RESTATEMENT OF THE PROBLEM
 
>Consider class A which counts its live instantiations.
 
     #include <iostream.h>
>    class A {
>        static int nr;
>      public:
>        A() {nr++;}
>       ~A() {nr--;}
>        static int getNrInstances (){return nr;}
>    };
>*      int A::nr = 0;
 
>A has useful functionality which I would like to use in other classes
>with MINIMAL change to the other classes. One way is to try inheritance:
                                           ---
>*   class B :public A {};
>*   class C: public A {};
 
>    int main (int, char**) {
>            B b1,b2,b3;
>            C c1,c2;
>*           cout << B::getNrInstances () << " instances of B ? \n";
>*           cout << C::getNrInstances () << " instances of C ? \n";
>            return 0;
>    }
    ----- output using Borland C++ v2.0-----
    5 instances of B ?
    5 instances of C ?
 
This seems to show that inheritance ties the FUNCTIONALITY to
the A subpart of B.
 
WHAT I AM INTERESTED IN IS THE FUNCTIONALITY OF "COUNTING ONE'S
OWN INSTATIATIONS", NOT COUNTING THE TOTALITY OF ALL INSTATIATIONS OF
CLASS A. THEREFORE THE OUTPUT I AM LOOKING FOR  IS
 
    ---desired output------
    3 instances of B ?
    2 instances of C ?
 
Could anyone enlighten me as to how to acquire the functionality of a
class like A that (that depends on a static variable) with LEAST
modification to the acquiring class ? It doesn't have to be with
inheritance. I would like to include this functionality for debugging
The test program would call the class B as in B::getNrInstances().
I would prefer not calling a B instance b1.getNrInstances(). The number
returned should be dependent only on the class and not on the particular
instance called (that's why I said static inheritance.) Am I being more
clear ? Thanks.
Newsgroups: comp.lang.c++