HDTenEightyP/NetNews huggingface dataset:
Newsgroups: comp.lang.c++
Subject: I need to pause until return is pressed...how?
From: kentiler@matt.ksu.ksu.edu (Kent Iler)
Date: 29 Jul 1992 12:54:53 -0500
Organization: Kansas State University
NNTP-Posting-Host: matt.ksu.ksu.edu

Hi,
  How, in C++, without including stdio.h can I wait until
<return> is pressed?  You can do a getc/getch by
using stdio.h, but I would think there would be some
way in C++ to do this without including that file?
										--Kent
Newsgroups: comp.lang.c++
From: iwirawan@tartarus.uwa.edu.au (Indra Wirawan)
Subject: BC++ 3.0 (Help !): Can't load Windebug.dll
Keywords: BC++ 3.0
Organization: University of Western Australia
Date: Sat, 25 Jul 1992 20:05:15 GMT

 I just installed BC++ 3.0 and everything looks fine except Turbo
 Profiler for Windows and Turbo Debugger for Windows. Here is my
 problem:
     - Both T. Profiler and T. Debugger refused to load a file (EXE file
       with its source code). The error message I received said "Can't 
       load Windebug.dll" (I launched them from Windows 3.1).

I've already checked that the file Windebug.dll exists in the same
directory as T. Profiler and T. Debugger reside in.

Have I done anything wrong ? (Path already set to include these
executable files).

Any suggestion will be appreciated.

Thank You

-------------------------------------------------------------------------
Indra Wirawan
The University of Western Australia
e-mail:iwirawan@tartarus.uwa.edu.au
       wirawa_i@kultarr.cs.uwa.oz.au


             "For things we have to learn before we can do them.
              We learn by doing"  
                                  Aristotle
--------------------------------------------------------------------------

 
Newsgroups: comp.lang.c++
From: sharma@euler.Warren.MENTORG.COM (Sharma Kunapalli)
Subject: inlining a virtual function.
Keywords: inline virtual
Organization: Mentor Graphics Corp. - IC Group
Date: Thu, 23 Jul 1992 17:17:51 GMT

Hi all: 
Consider the following code:

class A {
  virtual int f() { return 1; }
};

main()
{
}

When I run it using ATT3.0 and SUN2.1, I get the
following warnings: (using CC +w option)

CC  +w x.c:
"x.c", line 1: warning: virtual function  A::f() cannot be inlined
"x.c", line 7: warning: no value returned from main()
"x.c", line 7: warning: out-of-line copy of A::f() created

My question is why CANT we inline a virtual function?

I looked in the ARM and I cant find anything about 
inlining virtual functions.

All answers are appreciated. Thanks.

Sharma
-- 
The opinions expressed here are solely mine. My company has nothing
to do with these.

Email: sharma@euler.warren.mentorg.com
Newsgroups: comp.lang.c++
From: lagies@infoac.rmi.de (IBH Bernhard Hilpert )
Subject: c++ for embedded control
Organization: RMI Net INFO.box Systems * Aachen * Hamburg * Flensburg
Date: Sun, 26 Jul 1992 10:21:07 GMT

Newsgroups: comp.lang.c++
From: steve@taumet.com (Steve Clamage)
Subject: Re: C++ compiler macros
Organization: TauMetric Corporation
Distribution: usa
Date: Thu, 23 Jul 1992 19:20:45 GMT

kinne@delfin.com (Kinne Strong) writes:

>I wouldn't want to bet on the test of __STDC__ not generating an error
>when __STDC__ was not defined, either, although it worked just fine on
>Sun C++ when I tried it. Sun C++ seems to treat undefined symbols as
>having a value of 0 -- something I can find no justification for (though
>I haven't tried very hard). Anyone know if this can be relied on?

I couldn't find a mention of this in K&R1, but there is really very
little said about the preprocessor.

Harbinson and Steele in "C: A Reference Manual" state as unqualified fact
that undefined names in an #if are treated as having value 0.  They are
very careful about identifying behavior which varies among compilers.

I never heard of a C compiler which behaved differently, going back to 1979.

The ANSI/ISO C standard requires this behavior, as does C++.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Vice Chair, ANSI C++ Committee, X3J16
From: ccsmh@gdt.bath.ac.uk (Mark Harding)
Newsgroups: comp.lang.c++
Subject: Re: TMenuBox ? in TVision
Date: 29 Jul 92 08:20:26 GMT
Organization: University of Bath, England

pvonk@scott.skidmore.edu (Pierre VonKaenel) writes:

>I'm using Borland's Turbo Vision to write a menu program for our
>department.  I have a TMenuBar defined with appropriate submenus.
>What I need is a sub-submenu (or a pop up menu) and it seems TMenuBox
>should do the trick.  Unfortunately, there are no examples for using
>this class.

Because a lot of people have asked how to get sub-submenus in Turbo Vision,
and because I keep sending the same response I thought I'd post the solution.

Code is (c) 1992 Mark Harding - Bath University Computing Services

TMenuBar *TVBids::initMenuBar( TRect r )
{
	//
	//	Define the submenu for selecting databases.
	//
	TMenuItem& index  = *new TSubMenu("~C~itation Index",'C', hcNoContext) +
	*new TMenuItem("~S~cience", cmCScience, 'S', hcNoContext) +
	*new TMenuItem("S~o~cial Science", cmCSocial, 'o', hcNoContext) +
	*new TMenuItem("~A~rts and Humanities", cmCArt, 'A', hcNoContext );

	//
	//	Define the submenu for selecting Citation Index year
	//
	TMenuItem& year = *new TSubMenu("Index ~Y~ear", 'Y', hcNoContext) +
		*new TMenuItem("1981", cmC1981, cmNone, hcNoContext) +
		*new TMenuItem("1982", cmC1982, cmNone, hcNoContext); 

	//
	//	Define the menu bar for the User Interface
	//
	TSubMenu& sub1 = *new TSubMenu( "~\360~", 0, 0 ) +
	*new TMenuItem( "~A~bout...", cmAboutCmd, 'A', hcNoContext) +
	*new TMenuItem( "~S~etup Comms...", cmSetupComms, 'S', hcNoContext) +
	*new TSubMenu( "~F~ile", kbAltF, 0) +
	*new TMenuItem( "~C~hange Dir...", cmCDir, 'C', hcNoContext) +
	newLine() +
	*new TMenuItem( "~D~OS Shell...", cmShell, 'D', hcNoContext) +
	*new TMenuItem( "~Q~uit" , cmQuit, 'Q', hcNoContext ) +
	*new TSubMenu( "~C~hange", kbAltC, 0 ) +
//
// The all important sub sub menus!!
//
	index +
	year );

	r.b.y = r.a.y + 1;

	return(new TMenuBar(r, sub1));
}
From: nguyen@etamin.crd.ge.com (van-duc nguyen)
Newsgroups: comp.lang.c++
Subject: COOL C++ class library
Keywords: COOL, C++, library, template
Date: 31 Jul 92 17:01:53 GMT
Reply-To: nguyen@etamin.crd.ge.com (van-duc nguyen)
Organization: General Electric Research & Development

COOL is a C++ class library developed at Texas Instruments.

Features are:
1. Rich set of containers like Vector, List, Hash_Table, Matrix, etc...
2. Hierarchy is shallow with no common base class, rather than deep like
NIHCL. 
3. Functionality close to Common Lisp data structures, like GNU libg++.
4. Template syntax very close to Cfront3.x, g++2.x.
5. Free, with good documentation, and extensive test cases.

Light version of COOL from General Electric:
1. Hairy macros, run-time type, exceptions are removed for compatibility with 
   mainstream C++.
2. Free of memory leaks and bound violations. Leaks and bounds are checked with
   Purify.
3. Has memory management and efficient copy in expressions like: Set c = a+b+c;
   Pointers are shared with Handle and Reference count. Deep copy in
expressions
   are replaced by shallow copy.
4. Compatible with Cfront2.1, and is being converted to Cfront3.0.
   You can build both static and shared library on SunOS 4.1.x

Original version of COOL, compatible with Cfront2.0, can be ftp from:
csc.ti.com
GE version of COOL, compatible with Cfront2.1 can be ftp from:       
cs.utexas.edu

You are welcome to do anything you like with COOL.
I learned C++ from COOL. 

Van-Duc Nguyen
General Electric 
Research & Development Ctr
1 River Road, Room K1-5C39.
Schenectady, NY 12301.
Phone: (518) 387-5659
Fax:   (518) 387-6845
nguyen@crd.ge.com
Newsgroups: comp.lang.c++,comp.realtime
From: gratclif@magnus.acs.ohio-state.edu (Gregory W Ratcliff)
Subject: Re: Realtime C++
Keywords: Realtime, C++, Realtime Programming
Organization: The Ohio State University
Date: Thu, 23 Jul 1992 03:47:51 GMT

In article <3441@eastman.UUCP> spoelhof@kodak.com (Gordon C. Spoelhof) writes:
>Does anyone have any experience with object oriented (ala C++) programming
>in embedded realtime systems?  We are considerng C++ in some of our product
> stuff deleted....>
>Gordon Spoelhof / Eastman Kodak Co. / HSD 2-8-C-39105
>100 Carlson Road / Rochester, NY 14653-9105
>e-mail:  spoelhof@kodak.com       phone: (716)253-9734

We have been wanting to have a choice for a few years now.  The decision
has been made since no one (as far as I know) has released a C++ toolset
for the 64180/z80/68hcxx cpus.  I keep waiting, it may happen one day.

Gregory W. Ratcliff



-- 
Gregory W. Ratcliff
From: chrisf@brtph316.bnr.ca (Chris Fulmer)
Newsgroups: comp.lang.c++
Subject: Re: ||= and &&= operators
Date: 24 Jul 92 15:05:58 GMT
Reply-To: woodstock!chris@mcnc.org
Distribution: world
Organization: BNR Dept 3B91, RTP

I know I'll get flamed for this because my solution isn't exact, but
what about:

&&=  ->  *=
and
||=  ->  +=

Like I said, it isn't exact, but if you're just dealing with boolean
conditions and you don't care about the short-circuiting, you should
be fine.

(Yeah, there are other problems:  -1 is TRUE, overflows, etc...)

--
Chris
From: ark@alice.att.com (Andrew Koenig)
Newsgroups: comp.lang.c++
Subject: Re: C++ Return Types
Date: 21 Jul 92 22:30:37 GMT
Article-I.D.: alice.23269
Reply-To: ark@alice.UUCP ()
Organization: AT&T Bell Laboratories, Liberty Corner NJ

In article <1992Jul21.112354.1@vax1.umkc.edu> kramasamy@vax1.umkc.edu writes:

> 	If we adopt the second solution for the above class definition we run
> into problems of deallocating 'ptr' thro' destructor and the calling routine will
> get a garbage bitmap. How can we return for such cases?

By making sure the bitmap class has a properly defined copy constructor.
-- 
				--Andrew Koenig
				  ark@europa.att.com
Newsgroups: comp.lang.c++
From: mat@uunet.uu.net!mole-end
Subject: Re: template argument as base class
Organization: :
Date: Sun, 26 Jul 1992 02:59:42 GMT

In article <1992Jul24.195032.14884@delfin.com>, kinne@delfin.com (Kinne Strong) writes:
> stefan@mpi-sb.mpg.de (Stefan Naeher) writes:

> : template <class T> class XYZ : public T { };
> : cfront says
> : "sorry, not implemented: formal type parameter T used as base class of
> : template"

> : A possible application is the implementation of data types with
> : implementation parameters, e.g., dictionary<skiplist>,
> : dictionary<red_black_tree>, ....

> It sounds to me like what you really want is inheritance and virtual
> functions. ...

Inheritance can allow the smarts of the implementation to be shared, but
genericity (parameterization, in C++: templates) is necessary to put a
typesafe wrapper around it.
-- 
 (This man's opinions are his own.)
 From mole-end				Mark Terribile

 uunet!mole-end!mat, Somewhere in Matawan, NJ
Newsgroups: comp.lang.c++,comp.std.c++
From: mat@uunet.uu.net!mole-end
Subject: Re: Language extensions for run-time type identification
Summary: Eh?
Organization: :
Date: Fri, 24 Jul 1992 07:03:25 GMT

In article <1992Jul23.134515.12794@cadsun.corp.mot.com>, shang@corp.mot.com (David (Lujun) Shang) writes:
> In article <1992Jul21.143131.6902@cadsun.corp.mot.com>, shang@corp.mot.com 
> (David (Lujun) Shang) writes:

> > The pointer to vtable can not work as a type-ID for a language with
> > multiple inheritance. An object of particular class derived from
> > multiple bases may contain serveral different vtable references.
> > Different base pointers to the same object may use different vtable
> > pointers.

> In article <1992Jul22.091752.22521@mole-end> mat@mole-end writes:
> > Just a point of fact:
> > Not quite true. Those multiple vtable references in a complete object
> > all have to point to vtables whose only differences are their `offset
> > adjustments.'

> Good point! To compare two types then can be done by comparing the segment or
> page number of two vtables. The penalty is only for those C++ implemented in 
> 16-bit environment. The vtable reference cannot be a 16-bit pointer for small 
> programs.

David,

Eh?  I was not using `offset adjustment' in reference to a segmented memory
addressing scheme; I was using it to describe a necessary feature of a
vtable for MI: an explicit or implicit displacement by which a pointer must
be adjusted during the invocation of a virtual function.

And not to make you too happy: comparing vtable pointers could only be
a first step unless you are absolutely sure that the compilation and
linking system will never duplicate a vtable.  This is a hard assumption
to prove, especially with dynamic linking of new types.

OBTW, are you a typewriter-trained touch typist?  Your text has trailing
blanks on almost every line.
-- 
 (This man's opinions are his own.)
 From mole-end				Mark Terribile

 uunet!mole-end!mat, Somewhere in Matawan, NJ
From: ark@alice.att.com (Andrew Koenig)
Newsgroups: comp.lang.c++
Subject: Re: const on pass by value
Date: 30 Jul 92 14:44:27 GMT
Article-I.D.: alice.23361
Reply-To: ark@alice.UUCP ()
Organization: AT&T Bell Laboratories, Liberty Corner NJ

In article <1992Jul29.165553.28233@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:

> 	But the corresponding declarations

> 	foo(int);
> 	foo(const int);

> are ambiguous, they cannot be distinguished.

If your implementation doesn't reject them, as cfront does, it should actually
be possible to distinguish between them by using smoke and mirrors:

	extern void foo(int);
	extern void foo(const int);

	main()
	{
		void (*fp)(const int) = &foo;
	}

Unless void(*)(int) and void(*)(const int) are defined formally to be the same
type, the program above can distinguish them.  It is true that there is no
way to do so by a simple, direct call, but...
-- 
				--Andrew Koenig
				  ark@europa.att.com
From: junghyun@pollux.usc.edu (Jung-Hyun Han)
Newsgroups: comp.lang.c++
Subject: wow!! C++ interface
Date: 28 Jul 1992 11:24:31 -0700
Organization: University of Southern California, Los Angeles, CA
Distribution: world
NNTP-Posting-Host: pollux.usc.edu

thanx a lot for your kind replies
especially those who gave exact answers!!
the problem usually occurs when there are virtual methods
which are not provided but just defined as in 

Class A{
public:
	virtual doit();
};

but nowhere does 
A::doit(){
...
} appear.

sincerely, Jung
From: sjm@bcrki65.bnr.ca
Newsgroups: comp.lang.c++
Date: 18 Jul 92 00:48 MDT
Subject: Programming guidelines: naming of d
Nf-ID: #N:1992Jul17.204822.9087@bcrka451.b:564648094:001:1626
Nf-From: bcrki65.bnr.ca!sjm    Jul 18 00:48:00 1992


I am interested in your thoughts on naming conventions for (private or
protected) member data.  

The ARM, p170, says:

   Note that a name cannot denote both a function and a data member.
 
   class Y {
      int f();
      int f;     // error
   }

This means of course that I can't have both a data member called "name" 
and a get/set function name() and name(aString).

A much more minor problem is my annoying habit of selecting keywords for
data member names, e.g. "virtual" or "template".

Some people have suggested using the convention of prefixing data members
with an underscore, e.g. _name, _virtual and _template.   This is recommended
by Plum & Saks in "C++ Programming Guidelines", and recommended *against*
in the Ellemtel coding standards.

I am somewhat drawn to this convention (I hate fName, fVirtual, fTemplate),
but am also somewhat alarmed by the ARM, p.7:

   Identifiers starting with a single underscore (_) should also be
   avoided by ordinary users since C implementations reserve those for
   their own use.

My questions are:

1.  What conventions do you like for naming private and protected data
    members?  Why?

2.  What naming conventions do you use for get/set functions?

2.  Why the worry about what C compilers might do?  I have no intention
    of compiling C++ code with a C compiler  --  or are cfront compilers
    equally dangerous?

Stuart

: Stuart MacMartin                                    email: sjm@bnr.ca      :
: Bell-Northern Research                              phone: (613) 763-5625  :
: PO Box 3511, Stn C, Ottawa, K1Y-4H7, CANADA    Standard disclaimers apply. :
Newsgroups: comp.lang.c++
Subject: latest g++ for VMS?
From: elston%boot.decnet@edwards-tems.af.mil (Mark Elston, NSI Inc., Edwards AFB CA)
Date: 29 Jul 92 07:30:25 -0700
Organization: T&E Mission Simulator - Edwards AFB, CA

Does anyone know where I can get the latest port of g++ for VMS?

I have 1.37.1 but before I invest a lot of time trying to install it on our
system I might as well try to get the latest version.

Thanks for any help.

Mark
__________________________
Mark Elston
elston@edwards-tems.af.mil

Newsgroups: comp.lang.c++,comp.std.c++
From: shang@corp.mot.com (David (Lujun) Shang)
Subject: Re: Language extensions for run-time type identification
Reply-To: shang@corp.mot.com
Organization: Motorola, Inc., Software Research and Development, Rolling Meadows, IL. 60008
Date: Wed, 29 Jul 92 15:27:14 GMT

In article <1992Jul28.094428.15393@uunet.uu.net!mole-end>  
mat@uunet.uu.net!mole-end writes:
> 
> This is comp.{lang,std}.c++, not comp.object.  Your paragraph does not
> describe C++; it does not describe something that is C++ + <delta> .  (In
> comp.object, this might be an interesting journey upon which to embark.)
> 
The basic concept of derivation and virtualization is independent to any  
particular language. The assumption that only virtualization needs RTTI can not  
become reasonable in C++ while it is not reasonable in other OO languages.

David Shang
From: ado@ibg1.ibg.sub.org (Christoph Adomeit)
Newsgroups: comp.lang.c++
Subject: Determining object type at runtime ?
Date: 28 Jul 92 18:37:54 GMT
Organization: ibg

Hi C++ freaks,

I need an idea about how to solve the following problem:
I embedded some C++ classes into an interpreter (perl).
Perl only understands C-calls, so I wrapped some functions
like

extern "C"
{
  void *new_myobject(constructor vars)
  { return (void*)new myobject(constructor vars); }

	int myobject_print(void *myobj)
	{ 
		myobject *object=(myobject*)myobj;
		return object->print;
	}
}
	...

I can get a reference to myobject from perl by calling &new_myobject.
Afterwards I can work from perl with the class like this:
$object=&new_myobject(constructor vars);
$result=&myobject_print($object);

everything works fine !. The only Problem is, if the ptr passed to
myobject print is not a pointer to a class "myobject". The program
will of course dump core. How I can make sure that myobject->print
is only called with a valid ptr to an object of type myobject ?

One solution would be to implement a method "type" to all known objects
and compare object->type, but most of the time i call functions with
int's char's ... for which I can't implement such a method.

Another idea would be to keep a list of valid pointers for each known
object and look up the adress. I think it's the only way.

Any idea ?
-- 
Origin: It's not a bug, it's a feature !
Newsgroups: comp.lang.c++
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Subject: Re: boolean (was: Re: typedef vs enum)
Organization: MAXTAL P/L C/- University Computing Centre, Sydney
Date: Wed, 29 Jul 1992 17:12:51 GMT

In article <RJBODKIN.92Jul27182159@lister.lcs.mit.edu> rjbodkin@theory.lcs.mit.edu (Ronald Bodkin) writes:
>In article <1992Jul20.032111.22387@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
>   NOW if you add f(bool), it gets called by preference.
>
>	But then f(23) becomes f(TRUE), which might still cause
>problems, as in:
>int condition(int errno); // 0 = no error
>int condition(bool ok); // TRUE = no error
>		Ron

I dont understand. In my proposal, condition(int) is always called
unless an expression of bool type is used. 23 is an int. 
The only problem is 'what is 0'? since it is not really an int,
but an overloaded constant. 
-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
From: cep@taligent.com (Christophe Pettus)
Newsgroups: comp.lang.c++
Subject: Re: inlining a virtual function.
Keywords: inline virtual
Date: 23 Jul 92 20:42:02 GMT
Organization: Taligent, a little subsidiary of two really big companies.

In article <1992Jul23.171751.10146@Warren.MENTORG.COM> sharma@euler.Warren.MENTORG.COM (Sharma Kunapalli) writes:
>My question is why CANT we inline a virtual function?

You can.  What it means is that the compiler should use the inline
expansion if it class of the object can be determined at compile time,
or a virtual function call if it cannot (if you are using a pointer or
reference).  It sounds like the implementation has not yet caught up to
the ARM.
--
-- Christophe

"Be calm.  Look cute."
From: geise@ticipa.mtc.ti.com (Nick Geise)
Newsgroups: comp.lang.c++
Subject: Classes for i/f w/ modems via RS-232
Date: 24 Jul 92 15:33:50 GMT
Reply-To: geise@ticipa.mtc.ti.com
Organization: Process Automation Center

I'm looking for C++ classes that provide mechanisms for interfacing to
external devices such as modems via RS-232.  Currently running on 386
with windows 3.1 using Borland C++ 3.1 q/ App. Frameworks.  Please
send e-mail to geise@ticipa.mtc.ti.com.

Thanks,
--
Nick Geise                    Internet:  geise@ticipa.mtc.ti.com
Texas Instruments             TI MSG ID: NLG
PO Box 655012  MS 3635        Voice: (214) 917-2203
Dallas, Tx  75265             PC Drop: PFR1
From: trip@uts.amdahl.com (Tripatinder Chowdhry)
Newsgroups: comp.lang.c++
Subject: Good C++ Book
Date: 27 Jul 92 15:54:02 GMT
Reply-To: trip@amdahl.uts.amdahl.com (Tripatinder Chowdhry)
Distribution: usa
Organization: Amdahl Corporation, Sunnyvale CA

I am starting to program in C++.  I would appreciate if someone could
suggest a good C++ book.  I consider my self to be an intermediate
C programmer. I would like to consider a book with lot of examples
something similar to "A Book On C".
thanks
trip

trip@uts.amdahl.com
From: weh@abasin.dr.att.com (William E. Hopkins)
Newsgroups: comp.lang.c++
Subject: Found references to A++
Keywords: Annotated C++, A++, assertions, preconditions, postconditions
Date: 27 Jul 92 20:16:21 GMT
Organization: AT&T Bell Laboratories

I was able to find two references to what is known as Annotated C++ or A++
(``Annotated C++'' made electronic searches match on every reference to the
ARM, which is practically *all* C++ papers/books written since 1990...):

Cline, M., and Lea, D., ``Using Annotated C++,'' C++ at Work, Secaucus, NJ,
September 1990, p. 65.

Cline, M., and D. Lea, ``The Behavior of C++ Classes,'' Symposium on
Object-Oriented Programming Emphasizing Practical Applications (SOOPPA),
Marist College, Poughkeepsie, NY, September 1990, p. 81.


Unfortunately, those are not the easiest things to obtain (i.e., not in
AT&T corporate library).  Does anyone know of any other reference (I do
have librarians trying to get the above)?

		Bill Hopkins

P.S. Thanks to Mike Vilot for the pointer to the above in the class notes
     he wrote for TEC's Advanced C++ programming course.
Newsgroups: comp.lang.c++