HDTenEightyP/NetNews huggingface dataset:
From: chaiken@inode.com
Newsgroups: comp.lang.c++
Subject: HOW TO TURN PC SPEAKE
Date: 24 Dec 92 11:58:55 EST
Reply-To: chaiken@inode.com
Distribution: USA
Organization: inode BBS, Usenet Access for NYC (212-679-9146)

 -=> Quoting Mikey@ontek.com to News <=-

 Mi> This involves a simple hardware mod.  Turn off the power, disconnect
 Mi> the line cord and open the PC's case so you can get at the motherboard.
 Mi> Locate the speaker and take a sharp tool like a pencil and poke several
 Mi> small holes around the center of the speaker until the voice coil has
 Mi> been disabled.  Close it up and turn it on and test.  If you unplug
 Mi> your PC and move it to a different office, the speaker remains
 Mi> disabled, so I believe this is a portable solution to the problem.

This is a very permanent solution.  Why don't you just Open up the case,
cut one wire coming from the speaker and insert a SPST switch if you are
going to modify the hardware.

If you want to use a software solution, then you can simply toggle the
Speaker off bit.  on port 0x61; Bit 1.  0 is speaker off 1 is speaker
on.  You can also obtain Direct Speaker control through the 8253 Timer
chip. with bit one.  0 is Control via bit one of the 8255, 1 is control
via the 8255 Timer.

Note: This is only for machines which use te 8255 Programmable
Peripheral Interface

---------------------------------------------------------------------------
Jarett D. Chaiken
chaiken@inode.com


... Truth is stranger than fiction, because fiction has to make sense.
___ Blue Wave/QWK v2.11
Newsgroups: comp.lang.c++
From: pauljo@microsoft.com (Paul Johns)
Subject: Re: Bug in BC/C++ 2.0 ?
Date: 23 Dec 92 20:22:06 GMT
Organization: Microsoft:  Redmond, Washington, USA
Keywords: bugs

What's happening here is that the rules in C++ changed
AFTER the Borland 2.0 compiler was written.

In the old (before AT&T 2.1, I believe) days, you had
to specify the size of the array you were deleting.
And you had to get it right.  The old Borland compiler
is compatible with this old rule.

So "delete [] ..." is not legal for your compiler.
You have to supply a the size of the array between
the []'s.

An alternative that was used in the past was to omit
the []'s entirely if the array was an array of a built-in
type.

I **DO NOT** recommend this.  If you do this, the compiler
will generate a delete for a single object, not an array
of objects.  Using the wrong semantics for delete gives
undefined behavior.

What I do recommend is that you either:

1.  Upgrade your compiler to one that's AT&T 2.1-compliant.
	I think you should consider Microsoft C++, but I
	work for Microsoft and own Microsoft stock, so I
	have a clear bias.  :)

2.  Put the size in the delete.  This is upwards-compatible:
	it's ignored in AT&T 2.1 and 3.0.  This can be a little
	bit of a pain, but it's probably cheaper than upgrading.

Good luck!

// Paul Johns
From: davep@paladin.corp.sgi.com (David Packer)
Newsgroups: comp.lang.c++
Subject: Testing a pointer??
Date: 22 Dec 1992 00:57:50 GMT
Organization: Silicon Graphics Inc., Mountain View, CA
NNTP-Posting-Host: paladin.corp.sgi.com


Hey,

If I have a linked-list, called llist...and I want to test it
to see if it exists. i.e. I only want to create it if needed..

How do I test to see if it exists..

i.e.

if(!llist) { objList = new llist; }

this doesn't seem to work for me??

thanx 

Dave
Newsgroups: comp.lang.c++,alt.sources
From: patiath@umn-cs.cs.umn.edu (Pradip Patiath)
Newsgroups: comp.lang.c++
Subject: Coding Standards
Keywords: codeing standards
Date: 21 Dec 92 20:54:45 GMT
Organization: University of Minnesota

I am interested in finding out about any C++ coding standards like the
ones that exist for C. If anyone has information on the existence of
such a C++ standard anywhere, please email me at the following address:
 patiath@cs.umn.edu

I thank you for your help
-pradip
From: bright@nazgul.UUCP (Walter Bright)
Newsgroups: comp.lang.c++
Subject: Re: Bug in BC/C++ 2.0 ?
Keywords: bugs
Date: 30 Dec 92 07:34:27 GMT
Reply-To: bright@nazgul.UUCP (Walter Bright)
Organization: Zortech, Seattle

In article <BzrsxL.7t9@hpuerca.atl.hp.com> aaa@hpuerca.atl.hp.com (Simon Fowler) writes:
/In article <1992Dec23.202206.29576@microsoft.com>, pauljo@microsoft.com (Paul Johns) writes:
/> In the old (before AT&T 2.1, I believe) days, you had
/> to specify the size of the array you were deleting.
/> And you had to get it right.  The old Borland compiler
/> is compatible with this old rule.
/As is the Zortech compiler for OS/2 1.3.

This is corrected in the Zortech 3.1 update.
We still support OS/2 1.x.

/Not much alternative for OS/2 1.3
/> 2.  Put the size in the delete.  This is upwards-compatible:
/> 	it's ignored in AT&T 2.1 and 3.0.  This can be a little
/> 	bit of a pain, but it's probably cheaper than upgrading.

Zortech 3.1 issues a warning for this (but the warning can be turned off).
From: tk@dcs.ed.ac.uk (Tommy Kelly)
Newsgroups: comp.lang.c++
Subject: Re: FAQ for g++ and libg++, plain text version [Revised 4 Dec 1992]
Date: 24 Dec 92 21:28:57 GMT
Reply-To: tk@dcs.ed.ac.uk (Tommy Kelly)
Organization: Laboratory for the Foundations of Computer Science, Edinburgh U

In article <g++FAQ_12_1992_plain@ohm.berkeley.edu> jbuck@ohm.berkeley.edu (Joe Buck) writes:
>
>   Because the legal policies of Apple threaten the long-term goals of
>FSF, as well as the concept of free software, no support will be lent
>to efforts to port Gnu software to Macintosh or other Apple hardware.

Where can I find out more about FSF (and OSF?), and the free software concept
in general?

thanks,
tommy
Newsgroups: comp.lang.c++
From: suresh@argon.iss.nus.sg (Suresh Thennarangam - Research Scholar)
Subject: Re: Newing a pointer to a pointer
Reply-To: suresh@iss.nus.sg (Suresh Thennarangam - Research Scholar)
Organization: Institute of Systems Science, NUS, Singapore
Date: Wed, 30 Dec 1992 06:45:40 GMT

In article <1992Dec29.174843.20250@ncsu.edu> jlnance@eos.ncsu.edu (JAMES LEWIS NANCE) writes:
>
>I am attempting to learn C++.  I have declared a class called list and class
>called generic.  In generic, lspace is declared as:
>
>list **lspace.
>
>Both g++ and cfront tell me that the line containing new in the following 
>constructor has a syntax error.
>
>generic::generic() {
>this->lrow   = 100;
>this->lcol   = 100;
>this->lsize  = 0;
>this->lspace = new *list[lcol];
>this->addrow();
>printf("Constructing element\n");
>}
>Can someone tell me what I am doing wrong?

There is a syntax error ... are you trying to allocate an array of list * ?

This is the syntax you should use 

this->lspace = new list * [lrow] ;

This will allocate lrow pointers to arrays of list ; no constructor is called yet.

then you can allocate arrays of list like so

for(i =0 i < lrow; i++) this->lspace[i] = new list[lcol]; 

Hope that answers your question.

***************************************************************************
* Suresh Thennarangam               *  EMail: suresh@iss.nus.sg(Internet) *
* Research Scholar                  *         ISSST@NUSVM.BITNET          *
* Institute Of Systems Science      *  Tel:  (065) 772 2588.              *
* National University Of Singapore  *  Facs.: (065) 778 2571              *
* Heng Mui Keng Terrace             *  Telex: ISSNUS RS 39988             *
* Singapore 0511.                   *                                     *
***************************************************************************
From: rick.franks@hal9k.ann-arbor.mi.us (Rick Franks) 
Newsgroups: comp.lang.c++
Subject: NEW MEMBER
Date: 24 Dec 92 13:13:00 GMT
Distribution: world
Organization: HAL 9000 BBS, (313)663-4173, Ann Arbor, MI, USA
Reply-To: rick.franks@hal9k.ann-arbor.mi.us (Rick Franks) 

The folks down here in Myrtle Beach SC, would like to say hello
to you up in W-NET. And would like to inform you'all we are now
cross-linking this confernece with our own BUM_NET network.
Have a Merry Christmas and a Happy New Year...
---
 . Cam-Mail . The Chess Board BBS 803-236-7711 : Myrtle Beach, SC
                                                                               
Newsgroups: comp.lang.c++
From: steve@taumet.com (Steve Clamage)
Subject: Re: Undefined new and delete
Organization: TauMetric Corporation
Date: Tue, 22 Dec 1992 17:37:13 GMT

swk7@cbnewsk.cb.att.com (steven.w.koenig) writes:

>If one wanted to insure that no objects of a given type were ever created
>on the heap, it seems logical that one should be able to declare the
>new and delete operators as private but not define them. cfront 2.1
>only seems to support this if the constructors are inline. The following
>example works if A and ~A are inline, but
[ the linker complains that the new and delete are undefined ]
>if A and ~A are not inline. 

Unfortunately, making the new/delete private won't entirely prevent
objects from being constructed on the heap, since
	A *p = new A[10];
will access the global operator new, not the class-specific version.
(In the future, C++ will allow class-specific versions of the array
allocation versions of new and delete.)

To address your question, the functions show up as undefined due to a
common constructor/destructor implementation technique.

Typically, a flag is passed to the constructor (destructor) to indicate
whether the object needs to be allocated on (returned to) the heap.
The compiler generates code to test the flag and call operator new
(operator delete).  When the constructor/destructor is not inline,
the compiler can't detect that the calls to new/delete are not needed,
so they remain in the code.  (The may have to generate quite a lot
of hidden code in a constructor/destructor, and this is only part of it.)

This implementation technique is allowed by the ARM, and I don't
forsee anything in the emerging Standard to disallow it.  You can
define the functions as inline calls to abort() or assert() to get
around the problem.  It defers detection to run time instead of
link time, though.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Newsgroups: comp.lang.c++
From: shibuya@bl.applicon.slb.com (Hiroto Shibuya)
Subject: Variable length array in C++
Reply-To: shibuya@bl.applicon.slb.com
Organization: Applicon; Billerica, MA (USA)
Distribution: comp
Date: Mon, 28 Dec 1992 17:02:16 GMT

Question from C minded programmer.

What is a simple way in C++ to implement variable length array - an
array which grow in size as needed?  In C, I often use realloc to
reallocate an array to bigger size, but in C++, there is no
corresponding "renew" (?).  Do I have to revert to malloc and realloc?
My understanding was that I never have to use malloc in C++.

Description of class "Blocks" in USL standard components sounds like
what I need but I don't have access to that library.  So I appreciate
if anybody could tell me what is the common technique in C++ to
implement this kind of data type.  I just want to have simple array
and do not want to make list out of it.  Thanks in advance.  
--
					Hiroto Shibuya
			
					Applicon Inc.
					Billerica, MA
					U.S.A.




Newsgroups: comp.lang.c++
From: suresh@papaya.iss.nus.sg (Suresh Thennarangam - Research Scholar)
Subject: Sizeof and Virtual functions
Originator: suresh@papaya
Organization: Institute of Systems Science, NUS, Singapore
Date: Thu, 24 Dec 1992 06:12:54 GMT

One of the things that distinguishes virtual functions from other
normal member functions of a class is that some compilers that I
know of, store an extra pointer that is  probably used to index 
a vector table. This is done to facilitate late binding 
at run-time depending on the type of the object being pointed to
rather than the type of the object pointer as opposed to normal
member functions calls which are bound at compile time. 


Is this an implementation-specific issue only ?  

A C++ programmer should  not have to know of these ugly little pointers
lurking around in his structures. These monsters add 4 bytes each
(on a 32 bit machine) to your structure; sizeof no longer tells the 
truth and seemingly innocent  actions like fwrite'ing such structures 
to  a file can quickly assume rather pernicious connotations. 

If I write classes with virtual functions to interpret and save 
file formats like XWD, TIFF, GIF , etc and innocently use sizeof() 
to calculate the size and write to a file I will be writing along 
addresses in my machines data area. Obviously, no one will be able
to read those files either. Of course an experienced C++ programmer
would know how work around this problem  but this just an illustration. 

Isn't  there a better way to implement virtual functions ? 
Isn't the current implementation a clever hack at best ?


      __                  
     (_   / /  o_   o  o |_
     __)/(_( __) (_(_ /_)| )_


***************************************************************************
* Suresh Thennarangam               *  EMail: suresh@iss.nus.sg(Internet) *
* Research Scholar                  *         ISSST@NUSVM.BITNET          *
* Institute Of Systems Science      *  Tel:  (065) 772 2588.              *
* National University Of Singapore  *  Facs.: (065) 778 2571              *
* Heng Mui Keng Terrace             *  Telex: ISSNUS RS 39988             *
* Singapore 0511.                   *                                     *
***************************************************************************
Newsgroups: comp.lang.c++
From: erc@netcom.com (Eric Smith)
Subject: Re: Zortech C++ v3.1
Organization: Netcom - Online Communication Services (408 241-9760 guest)
Distribution: usa
Date: Mon, 28 Dec 1992 06:51:34 GMT

In article <1543@nazgul.UUCP> bright@nazgul.UUCP (Walter Bright) writes:
>One problem I have never solved is that the compiler is usually the first
>to support a new feature or platform, and it takes a while for the rest
>of the tools to catch up.


Is version 3.1 of the compiler much different from 3.04, or does it
mainly just add features?  Which of the bugs in version 3.04 have been
fixed in version 3.1?  How much memory will the Windows version
support?  3.04 was able to support a lot of memory by using old DOS
software with VCPI, but was limited to 16 megabytes with Windows/DPMI.
Does the new version still have that limitation, and does it still
support more than 16 megabytes with VCPI?

Please release a bug list, showing which bugs have been fixed.
Newsgroups: comp.lang.c++
From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
Subject: Re: testing for null pointer
Organization: Computer Science, University of Melbourne, Australia
Date: Tue, 29 Dec 1992 10:40:08 GMT

mbb@litwin.com (Mark Beyleveld) writes:

>Assuming I declare
>
>int* aPointer = 0;
>
>is it valid to write
>
>if (aPointer) {...}

Yes.

>Also, are the rules for pointers to member functions the same?

Yes. [See the reference manual sections 6.4.1 ('if' statements),
4.6 (null pointers), and 4.8 (null pointers to members)].
Actually 6.4.1 is perhaps a little vague. It says
	"The expression [in an 'if' statement] is evaluated and if it is
	 nonzero ..."
Presumably what it means for a pointer to member to be "nonzero" is for it to
be different to the pointer which results when a constant expression that
evaluates to zero is converted to a pointer to member (i.e. different from
a null pointer to member).

-- 
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: ccapps@convex.com (Carol Capps)
Subject: nihcl on hp-ux
Date: Wed, 30 Dec 1992 22:24:24 GMT
Organization: Engineering, CONVEX Computer Corp., Richardson, Tx., USA
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.


Does anyone have a version of nihcl ported to HP-UX?
If so could I please get a copy. If not
is anyone aware of potential problems in doing
such a port.
Thanks in Advance
Carol Capps
Newsgroups: comp.lang.c++
From: jimlynch@netcom.com (Jim Lynch)
Subject: Re: GNU C++
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
Date: Sat, 2 Jan 1993 17:02:30 GMT

I have little personal experience with gcc so far, however I have successfully
recompiled it on my unix dialup.

I am in the process of learning C++, and I intend to do so using gcc.

Gcc has a table-driven front end (for language specification) and back end
(for machine, base type and alignment specification). What this means is that
it's possible to make gcc compile on machines that it hasn't met yet. (this
works best for some particular class of CPUs, one expectation is lots of
general-purpose registers.) It also means that it's possible to make gcc compile
for a new language it's never met before. The way to do either language or
machine specification is to write the tables that describe them.

I personally like this: it means I could conceivably move a very high-quality
optimizing compiler to any machine I want, and that I could write a new language
and (once working) it would automatically run exactly the same on each and every
machine that gcc runs on.

I get to participate in the process of debugging the compiler. I like that
because I learn in the process. New versions are being worked on as we speak,
so it's current.

The only drawback is that documentation is a shade thin. It took me a month or
more before I successfully compiled the source of the compiler on my unix 
dialup.

A major benefit is the source code is freely available to whoever wants it.

The makers of gcc tried to make the command line options as close as possible
to unix cc, so if you've dealt with cc, you can use gcc.

I have a copy of the reference work, "The C++ Programming Language" which has
a (sortof readible) tutorial section. Since it's the definitive reference (and
since I have experience in compilers and compiler-compilers), it's very useful
because it offers opportunities to peek into the mind of the language's
designer.

I haven't gotten very far yet, but every example/excercise has worked on gcc.
From: jeff@kuhub.cc.ukans.edu (Jeff Bangert)
Newsgroups: comp.lang.c++
Subject: BC++ 3.1, outportb -> Bad call
Date: 1 Jan 93 08:10:40 CST
Organization: University of Kansas Academic Computing Services

Why does outportb produce the error message "Bad call to intrinsic
function"?

Here's what I know so far: I'm running Borland C++ 3.1 using
precompiled headers.  I've got a call to outportb which compiles
correctly almost all the time.  The call is in a .CPP file which
defines a device driver class.

Sometimes, when I try to compile the main program, I get an error from
the device driver -- outportb is a Bad call to intrinsic function.

I can fix this by deleting all the .SYM files, and then compiling the
device driver.  However, I would really like to know why I get the
error message.

Note: the line which contains the outportb compiles most of the time,
so there is nothing wrong with it.  Yes, I did include dos.h.  No, I
do not want to turn off precompiled headers.

Thanks for the help,

-- 
Jeff Bangert			jeff@kuhub.cc.ukans.edu
Computer Center			jeff@ukanvax.bitnet
University of Kansas
Lawrence, KS 66045
(913)864-0466
From: Neal.Sanche@ttlg.UUCP (Neal Sanche)
Sender: postmaster@ttlg.UUCP
Newsgroups: comp.lang.c++
Subject: Turbo Vision Query
Date: 02 Jan 93  19:15:02 mst

Hello All, 
 
I am having some difficulties with a particular part of my latest 
Turbo Vision application. I have an event which does various things, 
a dialog pops up for user input, then various ofstream objects are 
instantiated and some ostrstreams are used for in memory formating 
and so on. 
 
The funny thing is that after this routine is run, when I attempt 
to do a DOS Shell (using the standard method given in TVDEMO.CPP) upon 
return, the program hangs. The clock view, and heap view redraw, but the 
desktop, statusline and menubar do not redraw. The program is also hung 
because the clock does not update. CTRL-ALT-DELETE does not rectify the 
problem. 
 
Before the aforementioned routine is run, DOS shelling has normal effects. 
 
Can anyone help me with this problem? 
 
-Neal 
 
... OFFLINE 1.41 

 * Origin: Paradigm BBS: A programmer's paradise. (42:100/11)
Newsgroups: comp.lang.c++
From: rmartin@thor.Rational.COM (Bob Martin)
Subject: Re: Is it possible to use 'delete this' ?
Organization: Rational
Date: Mon, 28 Dec 1992 22:18:29 GMT

robertd@kauri.vuw.ac.nz (Robert Davies) writes:

|rmartin@thor.Rational.COM (Bob Martin) writes:

|>
|>In general, "delete this" is a bad idea.
|> .........

|This is the standard argument - but I suspect it is not necessarily the 
|correct one.

..........

|The danger with the statements that "delete this" is not a good idea is 
|that the compiler writers or standards committee will listen and a very
|useful construct (in some situations) will be lost.

OK, but the danger with remaining silent on the "delete this" issue is
that the folks who ask about it may get the idea that it is a
perfectly safe and benign technique -- it is not.  It is, in fact,
quite dangerous, and must be well controlled.  



--
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++
Xref: sparky comp.lang.c++:18647 comp.lang.c:19149