HDTenEightyP/NetNews huggingface dataset:
From: s026@brems.ii.uib.no (Paal K Holmberg)
Subject: Re: operator [][]
Organization: University of Bergen, Norway
Date: Mon, 9 Nov 92 11:45:16 GMT

In article <1992Nov9.095352.19114@fmrco.uucp>, pandrews@lovat.fmrco.com (Paul Andrews) writes:
|> 
|> (apologies if the syntax of the expanded function calls isn't quite correct).
|> 
|> (I would be interested to know if anyone has any other ways of doing this).
|> 
|> (Is there any standard nomenclature for classes like C and B above? something like
|> classB is a slave class, classC is a functor or what?)
|> 
|> ---
|> ---
|> Paul Andrews

since it os a trouble to get around mutiple []'s , you can always cheat and use a 
normal function element(int x,int y...) to get a certain element in the matrix or whatever.
I agree it is not as elgant as the [] approach, but it is easy.

-- 
 Paal Krebs Holmberg
 UiB
 Norway
 
 "To program, or not to program - thats not a question " ;-) 

                               |                          
                               |                           
                               |              
                              (n)             
                   X-----====(.i.)====-----X  
                      X       +++       X    
                               ~             
  		   Good flying,and check six
Newsgroups: comp.lang.c++
From: erc@netcom.com (Eric Smith)
Subject: Re: Criticisms Wanted
Organization: Netcom - Online Communication Services (408 241-9760 guest)
Date: Sat, 7 Nov 1992 11:34:44 GMT


You don't need excuses to stick with C.  You won't get arrested and
sent to jail.  Just do it.  If anyone asks you why you were too lazy
to learn C++, just tell them it's none of their business.

C has lots of advantages, if you do insist on having excuses.  For
example, it provides you with a steady stream of bugs to make you
look busy, which might get you a promotion or prevent getting laid
off.  But if you need excuses that sound plausible to manager types,
just talk about how the C++ compiler might have bugs, or the program
might use too much memory, or the language might take too long for
novices to learn, or the standard might keep evolving.

What did you do when you were in school and your teacher asked why
you didn't do your homework?  Just bring back that creativity and
you will be able to come up with all the excuses you need, without
asking the net.

If nothing else works, just say your dog peed on your C++ book.
Newsgroups: comp.lang.c++
From: pat@frumious.uucp (Patrick Smith)
Subject: Re: Just what is so great about streams?
Date: Sat, 14 Nov 1992 01:47:33 GMT
Reply-To: uunet.ca!frumious!pat
Organization: None

kanze@us-es.sel.de (James Kanze) writes:
|Does anyone know of a better way of handling IO formatting in a
|type-safe, extensible manner.  It's too late to change the iostream
|syntax, but I am curious as to what the alternatives are.

I've always thought it would be nice to be able to write
something like

   int i = 20, j = 17;
   cout["i = %d, j = %d\n"] << i << j;

This wouldn't involve any loss of type safety, since a separate
routine would be invoked for each type of value to be printed.
With some work, it could probably also be set up so that it
could be extended to printing user-defined types.

-- 
Patrick Smith
uunet.ca!frumious!pat
pat%frumious.uucp@uunet.ca
Newsgroups: comp.lang.c++
From: pickerig@eee.bham.ac.uk (Mr. G. Pickering)
Subject: Re: good c++ training videos
Date: Thu, 12 Nov 1992 09:36:35 GMT
Organization: The University of Birmingham, England
X-Newsreader: TIN [version 1.1 PL6]

Keith Brownlow (brownlow@informix.com) wrote:
: I'm looking for some training videos on c++, ideally designed for a competent
: C programmer switching to c++. If anyone has had any good experiences with
: a c++ video, could you please let me know the details of the video.  Or if
: you have had any BAD experiences please let me know also.  Either is MUCH 
: appreciated.
: 
: Keith Brownlow.


  We have the Borland C++ training video. It is an introduction to the
  C++ language features, contrasting them with C. It is funny, well written
  and easy to understand. It is a great intro into C++. It is not geared
  around Borlands products, although they are mentioned right at the
  very end.

  We used this video as part of a final year course on the B.Eng degree
  in Electronic and Electrical Engineering at Birmingham University.

  Guy.


--
+--------------------------------+-----------------------------------------+
| Guy Pickering                  | School of Electronic & Electrical Eng,  |
| E-MAIL: G.PICKERING@uk.ac.bham | University of Birmingham,               |
| Tel: (021) 414 4340            | Edgbaston, Birmingham. B15 2TT.         |
+--------------------------------+-----------------------------------------+
| "I have ten pairs of trainers...One for each day of the week" - Sam Fox  |
+--------------------------------+-----------------------------------------+


Newsgroups: comp.lang.c++
From: rbb@cs.brown.edu (Robert Baynes)
Subject:  Re: Creating a directory
Organization: Brown Computer Science Dept.
Date: Thu, 5 Nov 1992 13:15:30 GMT

Sometime ago I posted a request for help on creating a
directory name which needed to contain integers. I received
many responses and wish to thank everyone for their 
suggestions. The one that worked very well (and is 
enclosed below) uses the streams of C++ (which I was
looking for): 

ostrstream outd;


 	outd<< "./"<<"IA"<<IAID<<ends;
	mkdir(outd.str,mode);


------------------------old article-------------------------------


In article <1992Oct27.161738.3863@cs.brown.edu> I wrote:

>I am writing a routine to create a directory. Part of the 
>name of the directory is an integer that must be converted
>to chars. I am using mkdir.


>       Example:

>       int IAID = 244;
>	
>       char *path;
>       char *slash = "/";
>       strcat(path, slash);
>       strcat(path, IAID);

>       mkdir (path, mode);

>The problem is that IAID needs to be a char * to be strcat'ed to path.
>But how can this be done?? Does anyone know of a routine to convert
>an integer to a char * with out complaints at run time? If I cast
>IAID (char *)IAID, at run time I get an invalid address for the
>result.


Again, thanks to everyone you responded.
-- 
*******************************************************************************
	Bob Baynes		Department Of Computer Science
	rbb@cs.brown.edu	Box 1910, 115 Waterman Street
	(401)863-7684		Brown University
				Providence, RI 02912
*******************************************************************************
From: s026@brems.ii.uib.no (Paal K Holmberg)
Subject: Help! BC3.0 link problem
Organization: University of Bergen, Norway
Date: Thu, 5 Nov 92 12:53:13 GMT

 I have a problem with a a program i am writing: all the source-files compiles to .obj files
without a problem, but when the linker is invoked, it aborts to dos after a few files with the
following text:

exception 13: general protection fault at 0B1F:A3AF error code 0000
then it writes the contents of the registers, and then
error code 0000 limit=INVL segment#

handled exeception 000D at 0b1f a3af ErrCode 0000

I have not had this problem with other compilation of multiple files, so it is not a general problem with the compiler/linker. can anyone give me a pointer to what might be wrong ?
any help or information welcome.
thanks in advance.


-- 
 Paal Krebs Holmberg
 UiB
 Norway
 
 "To program, or not to program - thats not a question " ;-) 

                               |                          
                               |                           
                               |              
                              (n)             
                   X-----====(.i.)====-----X  
                      X       +++       X    
                               ~             
  		   Good flying,and check six
From: bs@alice.att.com (Bjarne Stroustrup)
Newsgroups: comp.lang.c++
Subject: Re: c++ & c+++
Summary: books
Date: 9 Nov 92 13:40:33 GMT
Article-I.D.: alice.24119
Organization: AT&T Bell Laboratories, Murray Hill NJ



mccauleyba@vax1.bham.ac.uk (Brian McCauley @ University of Birmingham) writes

 > In article <1992Nov8.222637.5773@nmsu.edu>, willittl@spock.NMSU.Edu (William  Little) writes:
 > > The books I bought were for beginners, and didn't tell me 
 > > much.  I went through them in a couple hours, and came up
 > > with some questions in areas they didn't cover.
 > 
 > Get the ARM (Annotated reference manual) I've never seen it but
 > everyone else sears by it! (I use "The C++ Prog.Lang.Edn.2" also by
 > the man himself which is probably not quite as good).

Depends what you need. The ARM and "The C++ Prog.Lang.Edn.2" cover the same
language (C++ including templates and exception handling) from two different
perspectives. They both contain the same reference manual.

The ARM is for language laywers and implementors and focusses on language
details and implementation techniques. Trying to learn C++ from the ARM is
a mistake; it would be like trying to learn English from a dictionary.

"The C++ Prog.Lang.Edn.2," on the other hand, tries to explain C++ programming
and design techniques. It is tutorial. Where it explains language features
it does so from the point of view of a user rather than an implementor.
I have been told that it is not only more comprehensive than the 1st edition
but also much easier to read.

I think the quality is about the same. Both have their place.
Newsgroups: comp.lang.c++
From: erc@netcom.com (Eric Smith)
Subject: Re: yacc and C++
Organization: Netcom - Online Communication Services (408 241-9760 guest)
Date: Tue, 10 Nov 1992 12:57:45 GMT


In article <1992Nov9.013842.28215@cs.brown.edu> hm@cs.brown.edu (Harry Mamaysky) writes:
>I have a slight problem. I am trying to use a YACC generated parser in
>a C++ system I have. This leads to the problem of getting YACC to know

I have found that using object oriented programming can drastically
simplify parsers such that I don't need to use lex/yacc but can just
write the scanner and parser directly in C++.  This makes it much more
flexible and much easier to fine tune for speed and better error
messages, etc.

I did that to implement a parser to parse C++, and was able to make it
give much better error message context than most C++ compilers.  For
example, if the error happens in a class and/or in a macro, a typical
C++ compiler error message just says what the compiler thinks is wrong,
but might not point out accurately the actual location in the code of
the error, because by the time the code has been preprocessed, etc., a
lot of the context information has been lost.  My C++ parser gives
accurate context information in all error messages, and if the error is
in a macro such that a typical C++ compiler would just show the macro
call as the location of the error, mine shows both the macro call and
the exact location inside the macro.
From: rhorn@csws12.ic.sunysb.edu (Robert Horn)
Subject: Re: Linking C++ and C
Organization: State University of New York at Stony Brook
Date: Fri, 13 Nov 1992 20:12:29 GMT

In article <BxMzLn.G9G@iat.holonet.net> rkinder@iat.holonet.net (Robert J. Kinder) writes:
>hclam@cuse1.se.cuhk.hk (LAM Ho Cheong) writes:
>: I got a problem of linking C & C++ programs using the Turbo C++ for
>: Windows on PC. I'm going to link some C source codes and some C++ 
>: source codes. I need to invoke certain C-like functions defined in a C++
>: codes in a C codes. However, the linker replies me that no such functions
>: have been declared. That means the functions defined in the C++ codes are
>: not accessable from the C codes. Can anyone give me some advice?
>: 
>: test1.cpp                          test2.c
>: ...                                main()
>: void f(void)                       {
>: {                                     ...
>:     printf("Hello, World\n");         f();
>: }                                     ...
>: ...                                }
>: 
>: linker error: "function _f is not declared in module "test2.c""!
>: 
>: It's natural because I'm using some more advanced stuff (C++) by a less 
>: advanced stuff (C). But, I need to solve this ...
>: 
>: I'll appreciate any advice sent to me at hclam@se.cuhk.hk
>: 
>: Thanks in advance.
>
>C++ is backward compatible with C.  There is all kinds of 'behind the
>scenes' stuff that goes on when initializing a C++ program.  I'm not all
>surprised that the linker couldn't find the C++ function f() identifier,
>probably due to C++ 'name mangling' if not several other things, too.
>
>Also, add the declaration 'extern void f( void );' somewhere in the first
>few lines of your test2.c module to tell the compiler the function resides
>somewhere else.  This is normally done in a 'header file' (.h or .hpp) and
>#Include'd in client modules.

in test1.cpp, it should help to put in the line

  extern "C" void f( void);


  extern "C" void f( void) {
   ....
  }

this informs the c++ compiler that void f( void) should have C linkage,
and thus, no name mangling. This is with cfront of HP-UX, so Turbo C/C++
might behave differently.
-- 
rhorn@ic.sunysb.edu         Never choose a college because it has a duckpond.
$@`                                             Send me hate mail, I love it.
Newsgroups: comp.lang.c++
From: gnk@belar.ECE.ORST.EDU (Giri Rangan)
Subject: Multiple representation of an object type
Organization: none
Date: Sun, 8 Nov 1992 00:41:08 GMT

Hi,

I am in search of a correct and a very efficient way of implementing
multiple representations of an object type. Here is an example :

I have a polynomial class. A polynomial can be represented in two ways.
One is to store the coefficients of each order term and the other way
is to store the roots of the polynomial. Both the representations are
useful and required, especially since my variable is a complex 
quantity ('z'). Hence, the coefficient representation is useful while
doing addition and subtraction of polynomials while the roots 
representation is useful while doing multiplication or division.

Another point to note is that the two representations are inter
convertible. As a result, if I change a particular coefficient, then
the present roots of the polynomial are no longer valid. They will have
to change too.

So how are such class types normally implemented ? I feel my  present
way of implementation is rather messy.

Please mail to :
gnk@aldur.ece.orst.edu
-- 
=================================================================                       
                        Giri NK Rangan
Dept of ECE, Oregon State University, Corvallis, OR 97331.
=================================================================
From: tmb@arolla.idiap.ch (Thomas M. Breuel)
Newsgroups: comp.lang.c++
Subject: Re: Just what is so great about streams?
Date: 13 Nov 92 10:29:51
Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
	Perceptive)
Reply-To: tmb@idiap.ch
NNTP-Posting-Host: arolla.idiap.ch
In-reply-to: tim@gold.iss.nus.sg's message of Thu, 12 Nov 1992 06:19:42 GMT

In article <1992Nov12.061942.16473@nuscc.nus.sg> tim@gold.iss.nus.sg (Tim Poston) writes:

   This posting is a genuinely answer-seeking question,

     what _is_ so great about streams?

Mainly that they are type-safe and user-extensible.

   From a coding standpoint, the << operator seems to be a case of
   `user-friendly disease'.  I have to do 'x << " " << y' just to get
   a space between output numbers.

Actually, I suspect most people would agree that stream syntax is
pretty awful.

   Typical user-friendliness: "don't worry about type, I'll look at it
   and do what's best", with no judgement needed by the programmer.
   But sometimes Mom does not know best.  For instance, if the output
   is PostScript code, a number very near zero should _not_ be output
   as 1.472e-6 It should be 0.0, or PostScript will barf.

Streams come with various formatting primitives for floating
point; use them.

					Thomas.
Newsgroups: comp.lang.c++
From: skdutta@ucs.att.com (Saumen Dutta)
Subject: Re: Desperate plea for help in writing C++ program!
Organization: AT&T Universal Card Services, Jacksonville FL
Distribution: usa
Date: Thu, 5 Nov 1992 13:07:03 GMT

In article <1992Nov1.212508.27282@galileo.cc.rochester.edu> fhsn_ltd@uhura.cc.rochester.edu (Farah Hussain) writes:
>
>
>
>
>Hello to all you C++ programmer geniuses!!!  I need your help in writing a 
>program in C++.  Because of illness, I have been unable to keep up with 
>everything in my class and would appreciate help from anyone.  If you 
>reply, I'll mail you my problem.  Thanks for your help!
>
>	e'mail me at :  fhsn_ltd@uhura.cc.rochester.edu

Though this looks like a desperate plea, I still don't think we must
allow this group to be used as a tool for solving assignments. Asking
specific questions should be alright but asking somebody else to
keep you in tune with the class should not be encouraged. Otherwise
we will be flooded with many such requests in no time. Like many others
I try to find time out of my busy schedule to read this group to 
learn and discuss C++. Please help us to save our time!

>
>Thanks 

Thanks
skdutta
From: rct@fulcrum.co.uk (Richard Taylor)
Newsgroups: comp.lang.c++
Subject: Re: Creating a directory
Date: 6 Nov 92 15:29:40 GMT
Organization: Fulcrum Communications

In article <720495783snx@trmphrst.demon.co.uk> nikki@trmphrst.demon.co.uk (Nikki Locke) writes:
>
>If you are using C++, look at streams.

                               ^^^^^^^
                               iostreams.

Regards,
============================================================================
Richard Taylor DoD #981 (rct@fulcrum.co.uk)              Heard on Radio 4:-
"One of the first signs of the male menopause is buying a Harley Davidson."
============================================================================
Fulcrum Communications Ltd., Fordrough Lane, Birmingham, B9 5LD, ENGLAND.
Newsgroups: comp.lang.c++
From: brianm@cc.gatech.edu (Brian N. Miller)
Subject: Re: Criticisms Wanted
Reply-To: brianm@cc.gatech.edu (Brian N. Miller)
Organization: College of Computing, Georgia Institute of Technology
Date: Sun, 8 Nov 1992 17:03:09 GMT

In article <BxDDJy.9GC@slipknot.rain.com> robert@slipknot.rain.com.UUCP (Robert Reed) writes:
>One criticism I've heard is that the time saved in debugging due to the strong
>typing is consumed in optimizing.

Strong typing complicates optimization?  I don't think so.  If anything, it
simplifies it.

>Also, I've seen complaints that tenet of information hiding and code reuse is a
>myth with C++ because in order to understand a class you intend to reuse, you
>must study the source code anyway.

That has little to do with C++.  I can't think of any language that
unambiguously illustrates ADT behaviour in the export interface.
Dean Jerding 
(dfj@cc.gatech.edu)
(ccsupdj@prism.gatech.edu)
From: rkinder@iat.holonet.net (Robert J. Kinder)
Newsgroups: comp.lang.c++
Subject: Re: Linking C++ and C
Date: 13 Nov 92 04:10:34 GMT
Organization: HoloNet (BBS: 510-704-1058)

hclam@cuse1.se.cuhk.hk (LAM Ho Cheong) writes:
: I got a problem of linking C & C++ programs using the Turbo C++ for
: Windows on PC. I'm going to link some C source codes and some C++ 
: source codes. I need to invoke certain C-like functions defined in a C++
: codes in a C codes. However, the linker replies me that no such functions
: have been declared. That means the functions defined in the C++ codes are
: not accessable from the C codes. Can anyone give me some advice?
: 
: test1.cpp                          test2.c
: ...                                main()
: void f(void)                       {
: {                                     ...
:     printf("Hello, World\n");         f();
: }                                     ...
: ...                                }
: 
: linker error: "function _f is not declared in module "test2.c""!
: 
: It's natural because I'm using some more advanced stuff (C++) by a less 
: advanced stuff (C). But, I need to solve this ...
: 
: I'll appreciate any advice sent to me at hclam@se.cuhk.hk
: 
: Thanks in advance.

C++ is backward compatible with C.  There is all kinds of 'behind the
scenes' stuff that goes on when initializing a C++ program.  I'm not all
surprised that the linker couldn't find the C++ function f() identifier,
probably due to C++ 'name mangling' if not several other things, too.

I suggest going to the Options | Compiler | C++ Options menu and set the
C++ compile switch ON regardless of the file extention (.C or .CPP), even
though your test2.c is a plain C module.

Also, add the declaration 'extern void f( void );' somewhere in the first
few lines of your test2.c module to tell the compiler the function resides
somewhere else.  This is normally done in a 'header file' (.h or .hpp) and
#include'd in client modules.

Always use function prototypes!

-- 
// rkinder@holonet.net            International Software Solutions, Inc.  -
// Robert J. Kinder, Jr.                             Boca Raton, Florida  -
//                                                        1-800-788-4774  -
//                    "No thanks!  I have a radio."
From: brendan@cygnus.com (Brendan Kehoe)
Newsgroups: comp.lang.c++
Subject: Re: g++ warning - destructor non virtual in inheritance relationship
Date: 9 Nov 92 21:41:45 GMT
Reply-To: brendan@cygnus.com
Organization: Cygnus Support, Palo Alto CA; Phone +1 415 322 3811
In-reply-to: ykim@cs.columbia.edu's message of Fri, 6 Nov 1992 05:12:38 GMT

In article <BxA3t2.39p@cs.columbia.edu> ykim@cs.columbia.edu (Yong Su Kim) writes:

   I have a class which inherits from two separate classes.

   eg class B: public c, public d

   and when I compile using g++, I get warning messages which say
   something about d's destructor being non virtual in inheritance
   relationship with B in the header file.

   It's just a warning, but I don't understand what is causing the
   problem.  If someone could point out what I am doing wrong, it would
   be great.  It's annoying having to see the same warnings again and
   again every time the .h file is included in a .cc file.


The warning derives from the notes in ARM section 12.4, advising that
as a rule of thumb, you should declare a virtual destructor in every
base class that has a virtual function.

Brendan
--
Brendan Kehoe                                               brendan@cygnus.com
Cygnus Support, Palo Alto, CA                                  +1 415 322 3811

Newsgroups: comp.lang.c++