HDTenEightyP/NetNews huggingface dataset:
From: manne@Minsk.docs.uu.se (Magnus L|vkvist)
Subject: Harbinson & Steele
Keywords: errata harbinson steele
Organization: UDAC, Uppsala, Sweden
Date: Wed, 9 Sep 1992 18:38:19 GMT

Is there an errata for the third edition of "C A Reference Manual" by Harbinson
& Steele?

/Magnus
From: wkaufman@us.oracle.com (William Kaufman)
Newsgroups: comp.lang.c
Subject: Re: SEX SEX SEX
Date: 10 Sep 92 03:55:51 GMT
Distribution: usa
Organization: Oracle Corporation, Redwood Shores CA
X-Disclaimer: This message was written by an unauthenticated user
              at Oracle Corporation.  The opinions expressed are those
              of the user and not necessarily those of Oracle.

In article <1992Sep7.144956.8667@merlin.dev.cdx.mot.com> lezz@merlin.dev.cdx.mot.com (Lezz Giles) writes:
] 
] I used to think that SEX was something to do with byte ordering in 16- or 32-
] (or more) bit values (or was it nybble ordering?)?  Does it mean something
] else as well?  Have I been spending too much time in front of my computer :-)

    No, you've just been slaving in front of the wrong machine.  SEX is
the 16-bit-to-32-bit Sign EXtension command.  Why, what did you think it
meant?

] Incidentally - has the term 'nybble' ever _really_ entered common usage or
] is it just a figment of my imagination?

    Well, it's also a figment of Apple programmers' imagination: I'd
seen it in Apple II docs.  I use it myself, in referring to bitwise
flags that only take up half a byte,... but I don't say it out loud.

                                           -- Bill K.

Bill Kaufman,          | "Hush my darling / Be still my darling /
Corporate Lackey       |  The lion's on the phone,..."
wkaufman@us.oracle.com |              -- "The Guitar", They Might Be Giants
From: ojuarez@mtecv2.mty.itesm.mx (Octavio Juarez Espinosa)
Newsgroups: comp.lang.c
Subject: Turbo C question
Summary: help
Keywords: help atof turboc 2.0
Date: 14 Sep 92 15:24:07 GMT
Organization: I.T.E.S.M. Campus Monterrey



Hi,


I'll appreciate if help me to find a problem in my program. I am using
turboc 2.0 and when I use atof, the compiler finish your work with the
next message:

	Scanf: float point formats not linked
	Abnormal program termination.

When I compile this program in turboc ++, there is not any problem.

Thanks in advance.

Sincerely,

Octavio Juarez Espinosa

-- 
Octavio Juarez Espinosa
Gabriel Valerio 1134 
Saltillo, Coahuila    CP 25000
Mexico  email ojuarez@mtecv2.mty.itesm.mx
From: will@turbo.bio.net (Will Nelson)
Newsgroups: comp.lang.c
Subject: sizeof()
Date: 9 Sep 92 21:38:29 GMT
Organization: GenBank Computing Resource for Mol. Biology

I've run into an incompatibility between Microsoft C 7.0
and the unbundled ANSI C compiler (1.1) of SUN Microsystems.

The deal is that the input file is a series of structs
that were written with fwrite on the DOS system. When I
fread the structs on the program compiled with Microsoft C
7.0 on DOS, they get read correctly. When I fread the structs
using the program compiled with SUN's acc on UNIX, the fread's
do not fill the buffer correctly. I have tracked it down
to a difference in what the sizeof() operator returns.

Here is the struct:

extern struct Feature_Form Feature_Form_Buffer;

struct Location {
  char base_position[7];
  int  operator_token;
};

struct Feature_Form {
  char ain_label[3];  /* 1 or 2 letter unique identifier for feature */
  char feature_key[16]; 
  char user_defined_feature_label[16];  
  char complement;      /* flag set if complement chosen from format */
  struct Location Start_Location;
  struct Location End_Location;
};


The fread's are done like this:

  while (fread(&Feature_Form_Buffer, sizeof(Feature_Form_Buffer), 1, mainfptr) =
= 1) {


If I look at what sizeof(Feature_Form_Buffer) produces, it comes out
as 56 on the DOS side and 60 on the UNIX side.

Needless to say, this looks like a show-stopper.
I've given up on trying to determine which is the "Correct" behavior,
mainly because I don't have the ANSI C standards document.
What I want to know is, is there any way to get the UNIX acc compiler
to give the same result as the DOS compiler? I would like to use
the same code in both environments if at all possible.
-- 
Will Nelson
Systems Programmer, IntelliGenetics, Inc.
will@presto.ig.com
Newsgroups: comp.lang.c
From: mjn@pseudo.uucp (Murray Nesbitt)
Subject: Re: EASY C
Organization: Private system in Toronto, ON
Date: Tue, 15 Sep 1992 04:44:23 GMT
	<faivre.716417831@cst02>


faivre@cst02.segin.com (Denis Faivre) writes:

>mjn@pseudo.uucp (Murray Nesbitt) writes:
>
>>If you want Pascal, you know where to find it.
>
>The goal isn't to change to another language, but to make C easier to learn,
>easier to read and easier to debug for programmers used to deal with COBOL.

My apologies...If you want COBOL, you know where to find it.

-- 
Murray
Newsgroups: comp.lang.c
From: bruce754@Armstrong.EDU (Phillip Bruce)
Subject: scanf() source
Organization: Armstrong State College, Savannah, GA
Date: Sat, 12 Sep 1992 18:28:43 GMT


Ok, I have a pretty simple question here.  Does anybody here have the C source for the "scanf()" function?  (Or fscanf(stdin,..))  If so, could you please mail it to me or post it up here (or both even!).

thanks,
d!ll!yd


bruce754@pirates.armstrong.edu
From: hawkeye@glia.biostr.washington.edu (Ken Keys - TF Dude)
Newsgroups: comp.lang.c
Subject: Re: How to call procedure with a variable?!
Keywords: C VARIABLE PROCEDURE
Date: 12 Sep 92 05:23:14 GMT
Article-I.D.: glia.hawkeye.716275394
Organization: University of Washington

In <68013@hydra.gatech.EDU> cc100aa@xray.gatech.edu (Ray Spalding) writes:

>In article <1992Sep11.145441.5720@cbfsb.cb.att.com> edb1@cbnewsf.cb.att.com (edward.benyukhis) writes:
>>In article <67971@hydra.gatech.EDU> cc100aa@xray.gatech.edu (Ray Spalding) writes:
>>>	t = gotoproc(1,2,3);
>>_________________________________
>>This is somewhat erroneous.  The way you invoke a function is:
>>	t = (*gotoproc)(1,2,3);

>Harbison & Steel (2nd ed. p. 273) say "In the function invocation
>f(...), the expression f may have the type "pointer to function...,"
>in which case an automatic dereference of the function pointer is
>made in order to perform the call."

>I believe this is OK per ANSI as well -- anyone know for sure?

Both forms are acceptable in ANSI C.  Some older compilers, however,
do require the * operator.  I personally think it makes more sense as
well, because it says what it does and does what it says.

-- 
Ken Keys, aka Hawkeye
Master of the Fugue
kkeys@ucsd.edu or hawkeye@ucsd.edu
Newsgroups: comp.lang.c
From: behrenss@Informatik.TU-Muenchen.DE (Soenke Behrens)
Subject: Re: fopen & binary mode
Organization: Technische Universitaet Muenchen, Germany
Date: Wed, 9 Sep 1992 16:59:23 GMT

chris@chinook.atd.ucar.edu (Chris Webster) writes:


>When I used to program with Borland C on PC's, the fopen call
>had binary mode.  This was accomplished by placing a 'b' after
>the mode (e.g. "r+b").  This prevented CR from being converted
>into CR/LF or something of the sort.

>My question is:  Does this apply to most installations of the
>C library?  Was it just a DOSism?  Should I continue to use it
>so my code is more portable?  The Sun compiler has not complained
>about me doing so.

Serious suggestion (perhaps we should place a sign outside of this newsgroup :)
following: Buy a book on C. You're better off. Either K&R 2nd ed or "C - 
A Reference Manual" are fine, though I prefer the latter. Also be sure to
get "C traps and Pitfalls", published by Addison.

As to your question: Binary mode is standard ISO, it is supported by every
stdio library.

Soenke
-- 
===========================================================================
More than silver, more than gold, I need   !    behrenss@informatik.
electricity. I need it for my dreams.      !    tu-muenchen.de
(RACTER)                                   !  FIDO: 2:246/13 Soenke Behrens
Xref: sparky comp.lang.c:13505 comp.lang.c++:13523
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: cBASE - Part 1
Date: 11 Sep 92 08:34:06 GMT
Followup-To: comp.lang.c
Organization: Comp Sci, RMIT, Melbourne, Australia

In article <1992Sep10.134151.8451@arrakis.denver.co.us>, thor@arrakis.denver.co.us (Robert B. Hood) writes:
> ------------------------- CBASE.CPP -----------------------------
> // cBASE - A dBASE III+ class for accessing and manipulating .DBF files.
> //                Copyright (C) 1992 Bob Hood
> //  -- `To Do' list --
> // 3. implement a linked-list quick sort routine (for indexing)

DON'T.  Use merge sort.  It is 10-20% faster than quick-sort's average
case, and its _worst_ case is about the same as quick-sort's _best_.
I'll provide one if you like.
-- 
You can lie with statistics ... but not to a statistician.
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.lang.c
Subject: Warning
Date: 9 Sep 92 07:45:39 GMT
Organization: Comp Sci, RMIT, Melbourne, Australia

I've just been trying to install a program that was written several years
ago and has been ported to quite a few UNIX systems.  Well, this time it
met a UNIX C compiler which was _determined_ to play by the ANSI rules.

It turned out that the code was riddled with instances of this pattern:

	... foo(...) {
	    SomeType bar();
	    ...
	}
	...
	static SomeType
	bar(...) { ... }

This gave no trouble at all with PCC-based compilers, and got by fine in
several others.  But _this_ compiler is strict about ANSI rules, and when
it sees this sort of thing, it says "ah hah, foo() is referring to an
_external_ function called bar()" and later it says "oh, there's a static
function called bar() as well, what a coincidence, well, so there are two
functions, that's all" and the linker ends up complaining that bar() is
not defined.

I just shuffled the functions around to respect definition-before-use and
deleted the "SomeType bar();" junk, which need never have been there in the
first place.

Also the original programmers made a point of never using "extern" if they
could possibly help it, so there were several things like
	/* File: lexer.c */
	int yyerrs;		/* note no initialisation */

	/* File: parser.c */
	int yyerrs;		/* note no initialisation */

My understanding is that these are tentative definitions, and that's ok.
However, this compiler appears to get it wrong; sticking extern in front
of either one made the linker error message go away.

This took enough of my time that I thought it would be worth warning other
people that even if you haven't got your hands on an ANSI C compiler yet,
it is worth getting tidying up this kind of thing right now.  Other people
trying to compile your code will thank you.

-- 
You can lie with statistics ... but not to a statistician.
Newsgroups: comp.lang.c
From: ccewch@nuscc.nus.sg (Wong Chee Heng)
Subject: General data structure and algorithm C source
Organization: National University of Singapore
Date: Wed, 9 Sep 1992 05:43:05 GMT

May I know if there is any sample C source that implement data structure
like linked lists, B-tree, sorting, etc. that are published in quite a 
number of books on C. 

Thanks for any info.

--
Wong Chee Heng
Systems Programmer

Newsgroups: comp.lang.c
From: krauss@oktext.sbc.com (M S Krauss)
Subject: Re: getting characters
Reply-To: krauss@oktext.UUCP (M S Krauss)
Organization: Southwestern Bell
Date: Fri, 11 Sep 92 18:36:27 GMT

In article <BuDt1C.38v@usenet.ucs.indiana.edu> foxd@silver.ucs.indiana.edu (daniel fox) writes:
>
>I would like to know what function call would enable me to get characters one
>at a time from the keyboard.  I have tried getc, scanf, etc, and keep running
>into the same problem.  The functions keep sitting there and waiting for a 
>return before allowing the program to proceed any further.  HELP!!!
>
>                                      Daniel B. Fox
>                                      KF9ET
>.standard disclaimer
>



At the risk of being flamed to death, try getchar().

Mike
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.lang.c
Subject: Re: 1992 International Obfuscated C Code Contest winners
Date: 14 Sep 1992 03:09:46 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: gandalf.think.com

In article <shrchin.716270955@reading> shrchin@csug.cs.reading.ac.uk (Jonathan H. N. Chin) writes:
>>>In article <1992Sep10.135002.25527@wraxall.inmos.co.uk> nathan@elberton (Nathan Sidwell) writes:
>>>>As chongo stated, my entry can't be posted from the USA.
>So what happens now that it has (I assume) entered the US via news?

Since forwarding is an automatic, passive activity, I don't think it would
be considered exporting.  Posting, on the other hand, is an intentional
act, and might be considered exporting.  I haven't heard of either
situation being tested in court, so it's really anyone's guess.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
Newsgroups: comp.lang.c,comp.lang.c++
From: freeman@gradient.cis.upenn.edu (Jon Freeman)
Newsgroups: comp.lang.c
Subject: Simple C question
Date: 10 Sep 92 03:41:30 GMT
Organization: University of Pennsylvania

I have a very simple question.  Once I saw the following declaration
in a C program:

long long x;

Well, I'm stumped.  Could someone please tell me what this means, and
what it accomplishes, if anything?

				Thanks,
				 Jon

-------------------------------------------------------------------------------
"If the accelerator (gas pedal) sticks, the   | Jon Freeman
car will often keep going faster and faster." | freeman@gradient.cis.upenn.edu
   --Pennsylvania Driver's Manual, p. 55      | Office: (215) 898-4612
Newsgroups: comp.lang.c
From: wilson@rhombus.cs.jhu.edu (Dwight Wilson)
Subject: Re: Help!!! Please Read this message!?!?!?!?!...
Organization: The Johns Hopkins University CS Department
Date: Fri, 11 Sep 1992 17:30:09 GMT

In article <MJN.92Sep11001608@pseudo.uucp> mjn@pseudo.uucp (Murray Nesbitt) writes:
>
>wilson@rhombus.cs.jhu.edu (Dwight Wilson) writes:
>
>>Huh?  "%f" specifies a double not a float.  If you think about the
>>promotion rule you'll realize that specifying a float would be
>>nonsensical since it is not possible for an argument to printf()
>>to be passed as a float!  
>
>    printf( "%f...%s?\n", (float)f, "Huh?" );
>
>It's another matter whether you'd *want* to pass a float to printf(),
>but it is possible.
>

This doesn't do it.  f is cast to a float, the compiler sees
that it's passing a float, doesn't see a prototype and says,
"Hmm, better promote this to a double".  Without a prototype,
it is impossible to prevent this promotion.

-Dwight

Newsgroups: comp.lang.c
From: thor@arrakis.denver.co.us (Robert B. Hood)
Subject: Re: cBASE - Part 1
Organization: Bob's Programming Paradise, Lakewood, CO, USA
Date: Sat, 12 Sep 1992 03:41:16 GMT

In article <14482@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes:
>In article <1992Sep10.134151.8451@arrakis.denver.co.us>, thor@arrakis.denver.co.us (Robert B. Hood) writes:
>> ------------------------- CBASE.CPP -----------------------------
>> // cBASE - A dBASE III+ class for accessing and manipulating .DBF files.
>> //                Copyright (C) 1992 Bob Hood
>> //  -- `To Do' list --
>> // 3. implement a linked-list quick sort routine (for indexing)
>
>DON'T.  Use merge sort.  It is 10-20% faster than quick-sort's average
>case, and its _worst_ case is about the same as quick-sort's _best_.
>I'll provide one if you like.

cBASE is certainly open for improvement (and I encourage everyone
to make their own attempt if they wish).  I would only ask that you
forward a copy of your improvements to me.

One of the comments I've received already is that it is not very
modular -- for C++ -- as their is no possibility for inheritance in
special instances.  I completely agree -- remember, this is my
*first* C++ work, so the comparitively-radical methodologies involved
in C++ over C are still a bit beyond my grasp.  If somebody else
can do better, please, PLEASE, do -- just send me a copy.

To that end (and because of an excellent question asked of me
concerning cBASE's portability), I am going to tinker with the
idea of creating a separate low-level file access class, and then
allow cBASE to inherit that class depending on the underlying
operating system.  In this manor, you could run cBASE on DOS,
UNIX, OS/2, etc., without changing the basic class.  Cool or what?

Bob
-- 
Bob Hood    thor@arrakis.denver.co.us     H: 303-980-8392  W: 303-632-2180
---------------------------------------------------------------------------
               The post office never loses you junk mail...
Newsgroups: comp.lang.c
From: jlg@cochiti.lanl.gov (Jim Giles)
Subject: Re: Giles' Manual Mania (Was - Re: About the 'F' in RTFM)
Organization: Los Alamos National Laboratory
Date: Tue, 8 Sep 1992 18:37:12 GMT

In article <1992Sep8.025007.24272@eslvcr.wimsey.bc.ca>, ted@eslvcr.wimsey.bc.ca (Ted Powell) writes:
|> [...]
|> Huh? I _read_ the "long list of inconsistencies" in the message you were
|> replying to, and they do nothing to support your "Just as I said" claim.
|> Those were infelicities in SCOPE, with no suggestion that they had
|> counterparts in UNIX. The "capabilities" listed (mostly in the line of
|> unintended program executions and file loss) pertained to SCOPE, with no
|> suggestion of similarity to UNIX.

One of the cases given for Scope was the result of one program's image
being put on top of another and losing the first image.  Nearly the
identical thing happens in UNIX when a piped set of processes fail:
the system dumps the `core' files all in the same place (if it bothers
to make core files at all) - losing all but the last image written - in 
short, a  crap-shoot if you're looking for the particular cause of the
fault.  Both *errors* in user interface design are the result of the
designer making assumptions about the batch file (yes, that's what shell 
scripts are) can do.  In short: the designers assumed (respectively) 
that (Scope) only one Fortran program will run before certain things 
were cleared and (UNIX) only one program will fail as the result of a 
single execution of a batch file (shell script).

Another example was the loss of files in Scope which you didn't 
explicitly save.  Well, the conventional method in UNIX for temporary 
files is to create a file (while opening it), destroy the file, but 
keep it open (so there's still a link).  This will automatically 
destroy the file when the process terminates - and there's nothing 
you can do to save it!  Since this is the conventional UNIX `idiom',
I've lost countless files this way - even when the process terminated
abnormally (ie. when you want *all* context saved so that you can
try to diagnose the problem).

Scope *was* a lot smaller and easier to use than UNIX and provided more
features in the kernel for the use of hardware capabilities (like 
asynchronous I/O).  For messing with text filters, UNIX has more
power than Scope did - for most other things, UNIX does not.  And,
the UNIX environment is *much* larger and harder to learn.  Due to
its checkered past, UNIX is also home to more (and more subtle)
inconsistencies.

-- 
J. Giles
Newsgroups: comp.lang.c,comp.sources.d,comp.unix.wizards,alt.sources,misc.misc
From: dsiebert@icaen.uiowa.edu (Doug Siebert)
Subject: Re: Optimizers and (NaN != NaN) (was Re: How is NaN recognized?)
Date: Mon, 14 Sep 1992 02:44:48 GMT
Organization: ISCA

In article <7301@charon.cwi.nl> dik@cwi.nl (Dik T. Winter) writes:
>In article <1992Sep13.233629.25805@kronos.arc.nasa.gov> raymond@kronos.arc.nasa.gov (Eric A. Raymond) writes:
> > >including a NaN itself. So `if (x != x) printf("A NaN\n");' could do
> > 
> > I tried this in one compiler and it didn't work.  It is possible that
> > the compiler optimized the test away.  Is there any way to eliminate
> > the optimization via a source hack?
>
>No.  Your best bet is to provide a separate function (in a separate source
>file):
>	int isequal(a, b) float a, b; { return a == b; }
>and to use it as:
>	if(!isequal(x, x)) ...
>but even in that case the compiling/linking system might inline the stuff
>and elide it because it is superfluous (in C's mind).

Isn't this one of the sort of things that ANSI added the 'volatile' type
modifier for, or am I misunderstanding how that would apply?

-- 
/-----------------------------------------------------------------------------\
| Doug Siebert                             | "I don't have to take this abuse |
| Internet:  dsiebert@isca.uiowa.edu       |  from you - I've got hundreds of |
| NeXTMail:  dsiebert@chop.isca.uiowa.edu  |  people waiting in line to abuse |
|     ICBM:  41d 39m 55s N, 91d 30m 43s W  |  me!"  Bill Murray, Ghostbusters |
\-----------------------------------------------------------------------------/
Newsgroups: comp.lang.c
From: wells@cdsmn.mn.org (Rich Wells)
Subject: Re: Help!!!  Please Read this message!?!?!?!?!...
Organization: Dicomed, Inc
X-Newsreader: Tin 1.1 PL3
Date: Fri, 11 Sep 1992 14:29:01 GMT

eletanjm@nuscc.nus.sg (TAN JIN MENG) writes:
: gmr6139@ultb.isc.rit.edu (G.M. Richard ) writes:
: : I can't get my compiler to do float-type variables.  I can do 
: : integers, and I can declare integers, but I can't either 
: : declare a real number or define a float variable.
: :  
: : /*  Variable Example */
: :  
: : #include <stdio.h>
: :  
: : #define apples  4
: : #define oranges 3.6
: :  
: : main()
: : {
: :         printf("\nApples = %d\nOranges = %f", apples, oranges);
: : }
: 
: Your compiler can't know what orange is... So it assumes that its an
: int. That's why the wrong result. Alternatives ...

Bzzzt.  Yes it does.  oranges is a floating point constant, and
should be treated by the compiler as a double, since printf is
defined as accepting a variable number of arguments.
-- 

Richard Wells  wells@cdsmn.mn.org  or  ...!tcnet!cdsmn!wells
From: shibuya@mailhost.bl.cad.slb.com (Hiroto Shibuya)
Newsgroups: comp.lang.c,comp.os.vms
Subject: opendir,readdir on VMS?
Date: 4 Sep 92 21:22:02 GMT
Reply-To: shibuya@mailhost.bl.cad.slb.com
Distribution: comp
Organization: Schlumberger Technologies CAD/CAM Division

In the comp.lang.c FAQ, it says

> 14.15:	How can I read a directory in a C program?
> 
> A:	See if you can use the opendir() and readdir() routines, which
> 	are available on most Unix systems.  Implementations also exist
> 	for MS-DOS, VMS, and other systems.  (MS-DOS also has FINDFIRST
                    ^^^		
>	and FINDNEXT routines which do essentially the same thing.)

Could anybody give me pointer to where about I can find the
implemenation for VMS?  Thanks in advance.

--
				Hiroto Shibuya
			
				Schlumberger Technologies 
				CAD/CAM Division
Organization: Junior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
Newsgroups: comp.lang.c,comp.os.msdos.apps,comp.os.msdos.programmer,comp.lang.c++
Date: Tue, 15 Sep 1992 23:31:32 -0400 
From: Stefan Monnier <sm86+@andrew.cmu.edu>
Subject: Re: Should I buy BC++ 3.1??
	<BuLMyD.Bvu@mentor.cc.purdue.edu>

Excerpts from netnews.comp.lang.c++: 15-Sep-92 Re: Should I buy BC++
3.1?? dve@mace.cc.purdue.edu (1833)
> 	Isn't Oberon a language instead of operating system?

Well, as Modula-2, Oberon is a language designed to
develop a complete system !
The difference is that the Modula-2 system was not called Modula-2
(I believe) but Oberon is the name of the language as well as 
the name of the system !

It is a language and it is a system !

	Stefan Monnier

-----------------------------------------------------
-- On the average, people seem to be acting normal --
-----------------------------------------------------