HDTenEightyP/NetNews huggingface dataset:
From: kolstad@cae.wisc.edu (Joel Kolstad)
Newsgroups: comp.lang.c,misc.forsale.computers
Subject: Books for C programmers for sale
Date: 9 Apr 92 17:45:52 GMT
Article-I.D.: doug.1992Apr9.124553.2864
Organization: College of Engineering, Univ. of Wisconsin-Madison
Originator: kolstad@ws-7.cae.wisc.edu


Hi, I got the following 2 books as part of a book club offer.  I'm really not
that interested in these particular books, though, so I'm trying to sell them
at reasonable prices.

"C Programmer's Guide to Graphics," by Al Stevens.
"C Database Development," by James W. McCarol.

I'd like $5 for each book, plus $2 for shipping.  So, buy one and it'll cost
you $7.  Buy both for only $12...  (These books generally cost much more,
of cuorse, but they didn't cost me much because of the above mentioned
book club offer...)

My e-mail address is kolstad@cae.wisc.edu.

						---Joel Kolstad
Xref: sparky comp.lang.c:7576 comp.sys.mac.programmer:8202
From: erh0362@tesla.njit.edu
Newsgroups: comp.lang.c,comp.sys.mac.programmer
Subject: Re: Problem De-allocating Memory in variable sized arrays
Date: 14 Apr 92 14:18:29 GMT
Article-I.D.: tesla.1992Apr14.091829.1
Organization: New Jersey Institute of Technology

> In <1992Apr1.222646.10433@coe.montana.edu> umsfjban@bill.oscs.montana.edu (Jeff Banfield) writes:
> 
> |void allocateDATA (void)
> |{
> |	register i;
> 
> |	DATA = (unsigned char **) NewPtr(NROW * sizeof(unsigned char *));
> |	DATA -= 1;	/* to allow indexing starting at 1 */
> 
> |	for (i = 1; i <= NROW; i++){
> |	    DATA[i] = (unsigned char *) NewPtr(NCOL * sizeof(unsigned char));
> |	    DATA[i] -= 1;  /* to allow indexing starting at 1 */
> |	}
> |}
> 
> Okay, this is really pretty nifty, excepting for the fact, pointed out
> by Steve Creps, that having a pointer to the 'element' before the
> first element of an array might cause you problems (such as it
> wrapping around to being a huge number, but even that might not cause
> a problem).  (Actually, since NewPtr probably has some housekeeping
> stuff before the actual allocated memory, as long as your element size
> is small enough I'm sure you'll be okay.)

 (various comments deleted )
 
> Would it be possible, with real (e.g., not Think C) C++ to define a
> class that is a 1-based array, and define the various operators on it
> (e.g., [], dereferencing, +) so they would convert it back to 0-based,
> and also define the casts to and from 0-based arrays, so that it would
> be impossible to make a mistake when passing arrays to and from
> routines that operate on 1-based arrays?  (The compiler would
> automatically convert if a routine that was declared to take an object
> of type 1-based-array were passed an ordinary C-based array, and
> vice-versa.)

	It's not only possible. It's a standard thing to do in certain 
circumstances. The trick that seems to be missed here is using two pointers 
instead of one. For instance to make an array of ints of dimension N that 
starts at index 1 do something like:

	int *temp, *myarray;

	temp = (int ) malloc(N * sizeof(int));
	myarray = temp - 1;

myarray now points to the element before temp. However you shouldn't actually 
dereference temp but instead use myarray[1] through myarray[N] to point to the 
appropriate elements. Using myarray[0] anywhere would cause untold havoc. This 
is all quite well documented in Numerical Recipes in C, along with routines to 
do similar things for multi-dimensional matrices.


Elliotte Rusty Harold		Department of Applied Mathematics
elharo@m.njit.edu		New Jersey Institute of Technology
erh0362@tesla.njit.edu		Newark, NJ 07103
From: jjj@mits.mdata.fi (Joni Jarvenkyla)
Newsgroups: comp.lang.c
Subject: Curses eats the right bottom corner? (ISC SysV3.2)
Date: 10 Apr 92 22:21:51 GMT
Organization: Microdata Oy, Helsinki, Finland


When I draw a box around the screen somebody goes and eats the right
bottom corner of the box? Why? How to fix it?

Doesn't matter whether I use box() or try to make for loops which print
characters on the windowsides.

-- 
jjj@mits.mdata.fi   Mind         Heart         No      Me
jjj@niksula.hut.fi  Difference   Destruction   Death   You
From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
Newsgroups: comp.lang.c
Subject: Re: Implementor's Namespace? (Re: atexit_t)
Date: 10 Apr 92 22:06:59 GMT
Organization: University of Helsinki

urmel!tornado!bara!wr writes:
>What exactly is the "implementor's namespace"? All names that begin
>with an underscore, or with a double underscore?

The implementor's namespace is all the names that the standard reserves
for the compiler and standard library writers' use.  It is basically the
names of all library functions, everything that begins with two
underscores or one underscore and a capital letter, and all names with
external linkage (i.e. global variables and functions) that begin with
an underscore.  A more complete list was posted to this newsgroup, I
think, and can be found for example at the end "Standard C", by P.J.
Plauger and Jim Brodie.  I do not know whether the standard itself
includes a list of reserved names, but it of course defines what names
are and are not reserved in some way.

--
Lars.Wirzenius@helsinki.fi
Xref: sparky comp.lang.c:7647 comp.programming:886
From: steve@dbaccess.com (Steve Suttles)
Newsgroups: comp.lang.c,comp.programming
Subject: Re: 1-800-SPELL-IT
Date: 15 Apr 92 02:03:16 GMT
Followup-To: comp.lang.c
Organization: Cross Access Corp., Santa Clara, CA

in article <andreww.702802050@suite.sw.oz.au>, andreww@suite.sw.oz.au (Andrew White) says:
> 
>>In article <1992Apr6.214828.15228@dsg.tandem.com> narayan@aravali.everest.tandem.com (Pankaj Narayan) writes:
> 
>>	   Does anyone have any programs that will take a string of digits
>>	   and convert them to something meaningful by matching them
>>	   against the telephone digit-to-alphabet table.
> 
>>	   e.g. if I had the number 773 5548, I could better remember it as
>>		  SPELL-IT.
> 
>>	   This is a problem in looking up many  combinations (3**7 )in /usr/dict
>>	   or something, but if someone has a solution, or would like to write
>>	   one, please post or mail it.
>> --

	[ grep -oriented partial solution (only 7-letter words) deleted ]

Actually, this "problem" is specifically addressed in Benchley's "Programming
Pearls" [blatant, deserved plug.  Go buy one now {not connected in any way,
must like to see credit given where due, and there's a lot due here}.].
It is in the section where the lesson is "Solve the right problem".
Rather than trying to search the entire dictionary, including lots of
unusable entries, preprocesse the dictionary to suit the application.

Make a modified copy of the dictionary which includes the telephone coding
of each word that can be coded.  If you'll allow Q and Z [not on the dial]
as standalone letters, act accordingly.  Store them both ways for retrieval,
and sort them.  Now its a simple matter to "look up the number", and you
can deal with short entries by recursion.  You even have the option of
"bailing out" by printing intervening digits "ONE-4YOU" and continuing.
You might consider the potential for mistakes ("1FO-RYOU" or "ONE-FORU" sound
the same as my quick example) before choosing a mnemonic like this.

My kid bought me a desk calendar version of Blanche Knott's "Truly Tasteless
Jokes" (she's put together several collections of these).  On the page
for the first of April, there is a toll-free, easy-to-remember dial-a-joke
number:  1-800-BK-JOKEZ.  It's a whole lot easier to remember than
the numeric equivalent!
-- 
Steve Suttles                Internet:  steve@dbaccess.com      Dr. DCL is IN!
CROSS ACCESS Corporation     UUCP: {uunet,mips}!troi!steve     Yo speako TECO!
2900 Gordon Ave, Suite 100   fax: (408) 735-0328              Talk data to me!
Santa Clara, CA 95051-0718   vox: (408) 735-7545   HA! It's under 4 lines NOW!
Newsgroups: comp.lang.c,comp.std.c,comp.arch
From: peter@ferranti.com (Peter da Silva)
Subject: Re: "long long" for 64 bits
Organization: Xenix Support, FICC
Date: Mon, 13 Apr 1992 13:13:47 GMT

In article <1992Apr12.050347.7785@msuinfo.cl.msu.edu> jap@convex.cl.msu.edu (Joe Porkka) writes:
> This makes the compiler uglier but does not force any one
> design decision onto *everything*. If a given chunk of code insists
> on having sizeof(int)==sizeof(long) it would be simpler to change
> the makefiles then to change the program. On the other hand
> much existing code would be perfectly happy with sizeof(int)!=sizeof(long)
> and could be compiled that way.

My suggestion is to make the base types:

	int8
	int16
	int32
	int64
	int128
	...

Then have appropriate virtual typedefs (controlled by command line switches)
that define int and long in terms of these. That will allow you to accomodate
all sorts of broken programs AND allow access to any integer size. You can
also allow "long long" to be set to one of these.
-- 
/F{findfont exch scalefont setfont}def /S{moveto show}def /T{/Times-Roman F}def
8 T(Ferranti International Controls Corporation)24 28 S(+1 713 274 5180)24 12 S
(Sugar Land, TX  77487-5012)24 20 S 12 /Courier F(`-_-')320 32 S( 'U` )320 16 S
12 T(Peter da Silva)24 36 S 16 T(Have you hugged your wolf today?)358 24 S
Xref: sparky comp.lang.c:7454 comp.lang.fortran:1806
Newsgroups: comp.lang.c,comp.lang.fortran
Subject: Re: FORTRAN to C translator
From: a_rubin@dsg4.dse.beckman.com (Arthur Rubin)
Date: 10 Apr 92 16:52:10 GMT
Distribution: world
Organization: Beckman Instruments, Inc.

In <1992Apr10.015209.7196@porthos.cc.bellcore.com> bm@nvuxr.uucp (B. Manseur, (908) 758-2505) writes:


>Hello everyone:

>Does anybody know if there is a program (FORTRAN or C)
>that can translate FORTRAN code into C code.  
>Any information would be appreciated.
>Thanks.

See comp.lang.c FAQ question 16.5:

Partial answer:

	f2c	jointly developed by people from Bell Labs, Bellcore,
		and Carnegie Mellon.  To find about f2c, send the mail
		message "send index from f2c" to netlib@research.att.com
		or research!netlib.  (It is also available via anonymous
		ftp on research.att.com, in directory dist/f2c.)
--
Arthur L. Rubin: a_rubin@dsg4.dse.beckman.com (work) Beckman Instruments/Brea
216-5888@mcimail.com 70707.453@compuserve.com arthur@pnet01.cts.com (personal)
My opinions are my own, and do not represent those of my employer.
Ich bin ein Virus.  Mach' mit und kopiere mich in Deine .signature.
Xref: sparky comp.lang.c:7552 comp.os.msdos.programmer:5360 comp.lang.c++:6726
From: epp@mala.bc.ca (Lorne Epp)
Newsgroups: comp.lang.c,comp.os.msdos.programmer,comp.lang.c++
Subject: Re: Borland Turbo C++ and memory problem at startup
Date: 13 Apr 92 14:28:19 -0700
Organization: Malaspina College

In article <1992Apr4.050007.6190@fid.morgan.com>, joec@fid.morgan.com (Joe Collins) writes:
> I have installed BORLAND TURBO C++ (V3.0) on my Gateway 386-25Mhz
> machine. In then invoke 'tc' and receive 'Memory manager cannot initialize'.
> I use EMM386 (for windows 3.0), but with no parms.
> 

Try using 'TC/X'.  It worked for me.
Newsgroups: comp.lang.c,comp.lang.c++,comp.windows.ms.programmer
From: ebergman@isis.cs.du.edu (Eric Bergman-Terrell)
Subject: I Hope the BC++ IDE Editor Supports OLE Soon
Organization: Nyx, Public Access Unix at U. of Denver Math/CS dept.
Date: Sat, 11 Apr 92 18:12:45 GMT

An interesting new feature in Windows 3.1 is object linking and embedding
(OLE).  A program (e.g. word processor) that supports OLE allows the user to
embed objects (e.g. spreadsheets, drawings, sound samples) inside the main
application's file.

For example, an editor could annotate a word processor document by embedding
a sound sample.  

I'm excited about the potential for using OLE in a compiler's text editor.
In addition to leaving voice annotations, etc., documentation could be inserted
in-line.  The documentation could be diagrams, word processor text, voice 
samples, even animated video.

Perhaps one of the reasons we programmers are often reluctant to write
in-line documentation is that the tools (tty-style editors) are so primitive.

I'd really like to insert a drawing to describe the interesting data structures
in my programs.  Animation might be overkill, but imagine how it would help
someone else understand the code!

IN SUMMARY:  Compiler vendors (Borland, Microsoft, etc):  Please support OLE
in future releases of your compilers' text editors.  No need to do anything
terribly fancy - just allow users to embed objects and don't compile them!

Terrell

Newsgroups: comp.lang.c,comp.programming
From: curt@watson.ibm.com (Curt McDowell)
Subject: Re: 1-800-SPELL-IT
Date: Thu, 16 Apr 1992 21:38:29 GMT
Disclaimer: This posting represents the poster's views, not necessarily those of IBM
Organization: IBM T.J. Watson Research Center
Keywords: permutation,telephone,dictionary,program

Here is a very short program which several friends have already used to generate
memorable telephonyms for various numbers.  The format of the input number is
not very important.  It generates all possibilities, so you should pipe the output
to a pager (more) or to a file for perusal.  Good luck -- relatively few numbers
have a good telephonym!

Example:  phone-cvt 555-1234

                                       Curt McDowell
                                       IBM Research
                                       curt@watson.ibm.com

-------------------- phone-cvt.c --------------------
/*
 * phone-cvt
 *
 *   By Curt McDowell
 *   IBM Research, 06-09-89
 */

#include <stdio.h>

char	phnum[40];

char   *poss[10] = {
	"", "", "ABC", "DEF", "GHI", "JKL", "MNO", "PRS", "TUV", "WXY"
};

permute(s, p)
	char   *s;
	int	p;
{
	char	c;
	
	if (s[p] == '\0') {
		printf("%s\n", s);
		return;
	}
	
	c = s[p];
	
	if (c < '2' || c > '9')
		permute(s, p + 1);
	else {
		s[p] = poss[c - '0'][0];
		permute(s, p + 1);
		s[p] = poss[c - '0'][1];
		permute(s, p + 1);
		s[p] = poss[c - '0'][2];
		permute(s, p + 1);
		s[p] = c;
	}
}

main(argc, argv)
	int	argc;
	char   *argv[];
{
	if (argc != 2) {
		printf("Usage: %s phone-num\n", argv[0]);
		exit(1);
	}
	
	strcpy(phnum, argv[1]);
	
	permute(phnum, 0);
}
---------------- end of phone-cvt.c -----------------
From: matt.johnson@ehbbs.hou.tx.us (Matt Johnson) 
Newsgroups: comp.lang.c
Subject: Re: Is the address of a g
Date: 10 Apr 92 13:12:00 GMT
Distribution: world
Organization: Ed Hopper's BBS - Houston, TX - 713-997-7575
Reply-To: matt.johnson@ehbbs.hou.tx.us (Matt Johnson) 

 On 04-08-92 STEVE CLAMAGE wrote to ALL... 
 
 SC> chupchup@ferkel.ucsb.edu (Robert Earl) writes: 
 SC>  
 SC> >jfw@ksr.com (John F. Woods) writes: 
 SC>  
 SC> >| The address of an object with static duration is ALWAYS a constant. 
 SC> >| It is NEVER an integral constant expression. 
 SC>  
 SC> >I quote K&R II: 
 SC> 
		 Sorry Steve, but with relocateable code, there is no way that the compiler 
		 could know the address of a variable.	For example, using a segmented 
		 architecture, the offset of the variable would be constant - but the 
		 segment would be known only at runtime.	With most of today's computers 
		 able to run several programs at once, how could the compiler of a given 
		 program know what the address of any variable would be for certain before 
		 the program runs? 
 
... OFFLINE 1.36 * J. Dahmer:  "My bologna has a first name, it's..."
Newsgroups: comp.lang.c
Subject: numeric to ascii
From: rdbrown@ualr.edu (Robert D. Brown)
Date: 7 Apr 92 20:22:02 GMT
Organization: University of Arkansas at Little Rock

What is the opposite of atof(), atoi(), and atol()?
Newsgroups: comp.lang.c
From: bolan@sdf.lonestar.org (Bolan Meek)
Subject: Re: Best compiler for learning C?
Organization: sdf Public Access UNIX, Dallas--unrestricted free shell access
Date: Sat, 11 Apr 1992 11:30:33 GMT

In article <CB.92Apr7152740@tamarack12.timbuk> cb@tamarack12.timbuk (Chris Brewster) writes:
>
>I'm new to C and need to learn it.  (I won't mention the language I know
>already, but it starts with F.)  I'm thinking of buying either MS Quick C
>or Turbo C++ for learning.  The selling points are that Quick C apparently
>includes some educational features, but Turbo C++ (obviously) includes C++,
>which I will also want to learn when/if I feel ready.  Adherence to
>standard C would be an advantage.  Please advise; thanks...
>
>Chris Brewster
/*   for learning C, I heartily recommend MIX PowerC, by MIX Software,
   1132 Commerce Dr., Richardson, TX 75081 (214) 783-6001.
  The entry-level is 19.95$+ tax (unless you're ordering from out-of-state,
or re-selling).
   For this you get a very good manual consisting of an excellent tutorial
that will take you throught all the basics, a reference manual that covers
the over 400 library functions (and macros), an ANSI statndard compiler,
3 math libraries (one using mathco, one using software emulation, and one
auto-sensing and switching -make that 4:  there is also an integer/no floating
point lib-).  for another 10$  you can get the source code to the function
libraries along with an assembler that will generate object code for
linking with object code generated by the C compiler.  the libraries are
a superset of those of MS C 4.0 & TC 1.0, including graphics functions.
for another paltry 19.95$+t, one may purchase a tracer/debugger similar to code
view.  I haven't purchased that yet, but I expect to do so soon.  they also
have a super math functions library, and a BCD business library...  uh...
well?  what else?...  anyway, "Joe" Bolan says:  "Check it out!"  */




PS  the reference manual also defines the language, variables, pointers,
arrays, structure, unions, precedence, etc. well, but not super-rigorously.
Also get K&RII...(what's it called?  The C Language Reference Manual?)
From: jfw@ksr.com (John F. Woods)
Newsgroups: comp.lang.c
Subject: Re: Is the address of a global a constant?
Date: 7 Apr 92 14:58:07 EDT

eric@pencom.com writes:
>Is the address of a global supposed to be considered a valid constant?

In what context?

>extern int a,b,c ;
>int foo(int *p)
>{      switch(p) {
>	case &a :    return 1 ;
>	case &b :    return 2 ;
>       case &c :    return 3 ;
>       }
>}

First, note that it is a *constraint* that "The controlling expression of a
switch statement shall have integral type", so gcc is correct to complain.
"The expression of each case label shall be an integral constant expression."
So gcc is correct to complain that the case labels are not integral constant
expressions.

The address of an object of static storage duration or of a function designator
is a legal address constant expression.  However, you need an integral constant
in this case.  
Newsgroups: comp.lang.c
From: alpha@wyvern.twuug.com (Joe Wright)
Subject: CFront
Organization: Tidewater UNIX Users Group
Date: Wed, 15 Apr 1992 02:37:54 GMT

I have seen much here (comp.lang.c) advising use of C++ for
certain things because "you can't do that in C".  Isn't it
that CFront takes C++ and outputs C?  Could one just code some
little trick in C++, run it through CFront and see what it looks
like in C?  Why not?
-- 
Joe Wright  alpha@wyvern.twuug.com
From: cmcgav@coos.dartmouth.edu (Christine B. McGavran)
Newsgroups: comp.lang.c
Subject: red/black trees
Summary: looking for code...
Date: 12 Apr 92 16:34:55 GMT
Organization: Dartmouth College, Hanover, NH

anyone have any c code for a red-black tree hanging around?  i'm too lazy to
write it.

thanks!
christine
Newsgroups: comp.lang.c
From: chupchup@ferkel.ucsb.edu (Robert Earl)
Subject: Re: passing structure to a function
Organization: (EVIL!)
Date: Fri, 10 Apr 1992 06:09:26 GMT

mcook@mrc.dev.cdx.mot.com (Michael Cook) writes:

| volpe@bart.crd.ge.com (Christopher R Volpe) writes:

| >C, whether it be ANSI or pre-ANSI, has always required that all parameters,
| >structures or otherwise, be passed by value.

| Except arrays.  They're passed by reference.

Arrays are never passed to functions.  A pointer to their first
element is passed instead, once again, by value.
-- 
robert earl		rearl@piggy.ucsb.edu

"eenie, meenie, chili beanie, your lucky number is... C!" ---Kelly Bundy
Xref: sparky comp.lang.c:7287 comp.std.c:1759 comp.arch:4770
From: sarima@tdatirv.UUCP (Stanley Friesen)
Newsgroups: comp.lang.c,comp.std.c,comp.arch
Subject: Re: PLEASE don't use "long long" for 64 bits + answer to letter
Date: 6 Apr 92 19:15:08 GMT
Reply-To: sarima@tdatirv.UUCP (Stanley Friesen)
Followup-To: comp.lang.c
Organization: Teradata Corp., Irvine

In article <aFeoiB1w164w@amfent.Gwinnett.COM> amf@amfent.Gwinnett.COM (Andy Feibus) writes:
|> Regarding ANSI compatibility, MIPS compilers have three modes:
|> strict ansi, ansi with extensions, and K&R.  We will support long long
|> in extended ansi and K&R, but not in strict ansi.
|Without having "long long" in strict ANSI mode, is "long" 32 bits or 64 bits?

Yes.

More precisely, it is implementation defined.
The only thing guarenteed is that:
	sizeof(long)*CHARBITS >= 32

since 32 >= 32 and 64 >= 32, both are legal implementations.
-- 
---------------
uunet!tdatirv!sarima				(Stanley Friesen)
From: eep1gd@ee.surrey.ac.uk (Gholamreza Danesfahani)
Newsgroups: comp.lang.c
Subject: TESTING
Date: 9 Apr 92 07:41:21 GMT
Reply-To: eep1gd@ee.surrey.ac.uk (Gholamreza Danesfahani)
Organization: University of Surrey, Guildford, England


PLEASE IGNORE THIS.  I AM TESTING
From: dgil@pa.reuter.COM (Dave Gillett)
Newsgroups: comp.lang.c
Subject: Re: End struct with unsized array?
Keywords: struct array unsized
Date: 14 Apr 92 02:20:34 GMT
Distribution: na
Organization: Reuter:file Inc  (A Reuter Company) Palo Alto, CA

In <1992Apr10.200130.24858@bronze.ucs.indiana.edu> burleigh@bronze.ucs.indiana.edu (Frank Burleigh) writes:

>typedef struct x
>{
>    int        i;
>    int        j;
>    SOMETYPE   k[]; /* perhaps not a good idea */
>} X;

>Actually the trouble comes with initialization, as the compiler
>complains that it doesn't know the size of an X.k.  


     As soon as you try to declare an X, the compiler is going to need to
know how big an X is, and that includes not only fields but any alignment
slop necessary to make an array of X's.

     You can get this effect, at some extra work, by making a SOMETYPE * in
the struct and a count.  Every time you make an X, and set the count and malloc
the appropriate size array, and remember to free it before the X goes away.
(In C++, you can automate the process with a constructor and a destructor, but
C++ is not C.)

                                                    Dave Gillett
Newsgroups: comp.lang.c
From: matt@centerline.com (Matt Landau)
Subject: Re: CFront
Organization: CenterLine Software, Inc.
Date: Thu, 16 Apr 1992 02:13:03 GMT

In <1992Apr15.221114.21776@dbsun.uucp> meyer@dbsun.uucp (Don Meyer) writes:
>True, cfront emits regular old K&R 'C' code.  As such, you can indeed
>"do anything" in 'C' that can be done is C++....
>
>What people mean is that you can't do some things in 'C' in a way that
>is maintainable....
>
>In brief, that's the situation.

Actually, that's NOT the situation.  Don't forget that cfront generates
extra code and then does some link-time magic with patch to arrange for 
static constructors and destructors to be called.  It's not as simple
as just generating C code.
--
 Matt Landau			Waiting for a flash of enlightenment
 matt@centerline.com			  in all this blood and thunder