HDTenEightyP/NetNews huggingface dataset:
From: dnl@convex.is.macsch.com (David Lombard)
Subject: Re: Typedefing builtin... thanks.
Organization: MacNeal-Schwendler Corp.
Date: Thu, 19 Nov 92 16:27:10 GMT

In article <1992Nov17.235519.24646@pure.com> rpeck@pure.com (Ray Peck) writes:
>
>The only problem with this is a WORD is not a portable concept (i.e.,
>people in 68k's call 16 bits a word, while people on Real Machines ;-)
>call 32 bits a word.  All modern machines use 32b and up.
>
>
>For this reason, I prefer types int8, int16, int32, or (better) u1b,
>u2b, u4b, (unsigned) and s1b, s2b, s4b (signed).
>

And people of Real Fast machines call a word 64 bits! :-)

Regards,
DNL

                 MY_COMMENTS = MY_OPINIONS = NOBODY_ELSES;

David N. Lombard    The first thing we do,         The MacNeal-Schwendler Corp
dnl@macsch.com      Let's kill all the lawyers.    815 Colorado Blvd
(213) 259-4911      II Henry VI, IV.ii             Los Angeles, CA  90041
Newsgroups: comp.lang.c
From: David.Empson@bbs.actrix.gen.nz
Subject: Re: 2-D Arrays, Revisited.
Organization: Actrix Information Exchange
Date: Wed, 18 Nov 1992 12:23:42 GMT

In article <17489@pitt.UUCP> fahad@cs.pitt.edu (Fahad A Hoymany) writes:
> I am writing a function that should accept a 2-D array (hopefully of any
> size), operate on that array, and returns 'anything' to the caller. Please
> don't suggest I use double pointers because I do not want to restrict the 
> users of my function to use them when they are used to declaring arrays
> as : int a[2][5]. 
> 
> What should the formal parameters line look like?

int my_array_function(int a[][5], int nrows) {
    /* ... */
}

You can refer to array elements within the function as normal, e.g.
a[i][j] will refer to the ith row and jth column.

The function should be called with the name of a compatible array.


In C, only the leftmost dimension can be left unspecified.  All other
dimensions must be fixed.  If you want a 2-D array that varies in both
dimensions, you will have to do something rather more ugly, e.g.:

int another_array_function(int a[], int nrows, int ncols) {
    /* To refer to element a[i][j], use: */
    temp = a[i * ncols + j];
}

and to call this function, given an array b[10][2], you would use:

    temp = another_array_function(b[0], 10, 2);

or

    temp = another_array_function(&b[0][0], 10, 2);


Hope this helps.
-- 
David Empson

Internet: David.Empson@bbs.actrix.gen.nz    EMPSON_D@kosmos.wcc.govt.nz
Snail mail: P.O. Box 27-103, Wellington, New Zealand
From: dhunt@infocom.UUCP (David Hunt)
Newsgroups: comp.lang.c
Subject: Re: Can you program in C?
Date: 21 Nov 92 10:37:55 GMT
Distribution: world, local
Organization: INFOCOM Public Unix Server, +44 [0] 734 340055

mccall@mksol.dseg.ti.com (fred j mccall 575-3539) writes:
> Quite true.  I hadn't considered that.  I suppose he COULD be from
  [stuff deleted]

> U.K. and studying over here.  However, given the relative odds, I
> think the assumption that he

I suppose he could be Russian, Chinese or Possibly Iraqi, don't they have 
nuclear subs as well

> bet.  Perhaps someone should get the address for the Navy ROTC
> commander at his school?
> 

God help us all, if this is the standard of prospective US Navy Officers

-- 
________________________________________________________________________
dhunt@infocom.co.uk  "Badges!, What Badges? We need no stinking badges!"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: bhaley@sw.stratus.com (Brian Haley)
Newsgroups: comp.lang.c
Subject: Re: Can you program in C?
Date: 17 Nov 92 23:02:00 GMT
Organization: Stratus Computer, Inc.
NNTP-Posting-Host: osn.sw.stratus.com

In article <00963BF4.675CEA80@vms.csd.mu.edu>, 2644danticoj@vms.csd.mu.edu writes:
> ...
> So, can you help me write these programs ...
>

I wish there were more students like you to compete with for a job
when I graduate next year.  I couldn't help but get hired since I at
least have the desire to learn something.  I hope there are no suckers
that will actually do all your work for you.


You deserve a flame, so ~~~~~~~~~ here it goes

You're impression of the world:

Employer: "Do you know any C?"
You: "No, but I heard there's people on the net that do."
Employer: "You're hired!"


-Brian


Statements I make are of course my own and no reflection on my employer.
************************************************************************
bhaley@sw.stratus.com
Brian Haley
Stratus Computer Inc.
************************************************************************
From: ah739@cleveland.Freenet.Edu (Leslie J. Somos)
Newsgroups: comp.lang.c
Subject: Re: ANSI C document required (FAX or e-mail)
Date: 16 Nov 1992 14:06:21 GMT
Organization: Case Western Reserve University, Cleveland, OH (USA)
Reply-To: ah739@cleveland.Freenet.Edu (Leslie J. Somos)
NNTP-Posting-Host: slc4.ins.cwru.edu


In a previous article, broglia@ghost.dsi.unimi.it (marco broglia) says:

>
>We are researchers of the Computer Science Department, University of
>Milan (Italy), and we're interested in getting a copy of the Standard
>document about ANSI C (maybe X3.159-1989 from last FAQ).
>Our problem is that we're looking for a fax number or e-mail address on
>which ask for detailed info about this.
>Thanks in advance and
>    Best regards.
>
>/*
> * Marco Broglia    broglia@mars.usr.dsi.unimi.it
> * Stefano Gobbo    gobbo@ipmel2.elet.polimi.it
> */
>

Read the group comp.std.c

From what I remember, what you are asking for is not
available electronically, because it costs money ( ~$50 ).
You have to contact ANSI directly (in New York City).
(But don't wait too long.  I understand that the next
version from ANSI will be 'synchronized' with the ISO
standard, meaning mostly that it will omit the 
commentary giving the reasons behind everything.)

--
Leslie J. Somos    ah739@Cleveland.Freenet.Edu
From: cs161feu@sdcc10.ucsd.edu (Anthony Minkoff)
Newsgroups: comp.lang.c
Subject: Array of pointers to constant functions?
Date: 19 Nov 92 22:19:45 GMT
Organization: University of California, San Diego


I want to declare an array of pointers to constant functions.  (Is
that last bit redundant?)  I.e., what I want is an array of pointers
to functions.  Each of these functions is defined at compile time,
and I'd rather not have to give a name to each of these functions
(except, of course, for the name of the array).

To make it a little clearer, the following code fragment describes
the essence of what I want to do (except that the below code is not,
of course, syntactically correct C):


        main()
        {
            void (*functions) [2] ( int x ) = {
                { printf("zero! %d\n", x); } ,
                { printf("one! %d\n", x); }
                                              } ;

            int n;

            /* somehow choose n = 0 or n = 1 */

            functions[n]();
        }


Does C support what I want to do here?  If so, how do I do it?  I
have not been able to find it in reference books.  (The functions,
of course, could be any arbitrary functions.  I realize there are
much easier ways of doing what this code would do, but I'm
interested in the general problem.  This example is used merely for
illustration.)

Thank you very much.

Tony 

P.S.: If there is no solution in C, but there is one in C++, I am
also interested in that.  However, I would prefer a C solution.
Newsgroups: comp.lang.c
From: peter@ferranti.com (peter da silva)
Subject: Re: postfix indirection operator in C
Organization: Xenix Support, FICC
Date: Thu, 19 Nov 1992 20:32:21 GMT

In article <722061083@sheol.UUCP> throopw@sheol.UUCP (Wayne Throop) writes:
> Actually, I often use the C postfix indirection operator "[0]",

Nice trick, but it doesn't work in declarations which is where most of
the problems lie.
-- 
Peter da Silva / 77487-5012 USA / +1 713 274 5180
true(<<VV$@\\$'&O 9$O%'$LT$&$"V6"$&$<4$?'&$ #I&&?$=$<<@)24 24 scale 3 21 moveto
{dup 36 eq{pop not}{dup 7 and 4 sub exch 56 and 8 div 4 sub 2 index{rlineto}{
rmoveto}ifelse}ifelse}forall stroke pop showpage % Har du kramat din varg idag?
Newsgroups: comp.lang.c
From: bobb@netcom.com (Bob Beaulieu)
Subject: Reading Filenames into an ARRAY
Keywords: in MOSDOS, Borland C 3.1
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Date: Wed, 18 Nov 1992 16:45:44 GMT

I want to be able to display a list of specific files in the current
directory from within my program. I want to be able to allow users to
select from a list of these file to be acted upon (printed,deleted,...).

Is there an easy way to do this? It has to be DOS 2.0+ and not a
windows application.

Any helpful comments will be appreciated!

Thanks,

Bob Beaulieu
bobb@netcom.com
-- 
 =============================================================
 Bob Beaulieu                                 bobb@netcom.com  
 San Jose, CA                                 (408) 978-0818  
 =============================================================
From: darcy@druid.uucp (D'Arcy J.M. Cain)
Newsgroups: comp.lang.c
Subject: Re: Multiple Parameter Passing (unspecified number)
Date: 22 Nov 92 12:41:59 GMT
Organization: D'Arcy Cain Consulting

dfuller@portal.hq.videocart.com (Dave Fuller) writes:
>GNR100@psuvm.psu.edu writes:
>:    I'm looking to write a function that accepts any number of paramerter.
>    Sort of depends. UNIX versions will use definitions from varargs.h and 
>non-UNIX platforms use stdarg.h (I believe these are the correct header files).

No it doesn't depend on Unix vs. non-Unix platforms.  If you have an ANSI
standard compiler (or even some that are otherwise non-standard) you use
stdarg.h.  Where do you get your information Dave?

> [...]
>(not all of these are macros. va_alist, va_dcl, and va_list are variables)

va_list is a type, not a variable.  va_dcl is more like a magic token.
It is a declaration for the va_alist parameter.

-- 
D'Arcy J.M. Cain (darcy@druid.com)  |
D'Arcy Cain Consulting              |   There's no government
Toronto, Ontario, Canada            |   like no government!
+1 416 424 2871          DoD#0082   |
Newsgroups: comp.lang.c
From: misar@rbg.informatik.th-darmstadt.de (walter misar)
Subject: Re: Multiple Parameter Passing (unspecified number)
Date: Tue, 17 Nov 1992 08:31:23 GMT
Organization: TU Darmstadt

In article <92321.124834GNR100@psuvm.psu.edu>, <GNR100@psuvm.psu.edu> writes:
>    Hi.
> 
>    I'm looking to write a function that accepts any number of paramerter.
> There will be at least two, an int and a char[]. The rest will all be char[]'s.
> I need to know how this is done.  The meathod would be similar to that of
> printf(), so if anybody know how that works, please let me know.

If you use an ANSI compiler it will look like this:

#include <stdarg.h>

void fun(int i,char s[],...)	/* 3 dots exactly	*/
{  va_list argp;
    /* more variables */

   va_start(argp,s);		/* 2nd arg is last named fun-arg	*/
    /* with va_arg(argp, TYPENAME) you can step through the arg-list,
       the macro will provide always the next one, TYPENAME is the type
       of the arg (in this case char * or char [])
    */
    /* some code */
    va_end(argp);

}

Hope this will help,
Walter

-- 
Walter Misar
misar@rbhp56.rbg.informatik.th-darmstadt.de
Newsgroups: comp.lang.c
From: ted@ocsmd.ocs.com (Ted Scott)
Subject: Re: Where are literals stored?
Organization: Online Computer Systems, Inc.  Germantown, Md., 20874
X-Newsreader: Tin 1.1 PL5
Date: Fri, 20 Nov 1992 16:19:08 GMT

Chris Torek (torek@horse.ee.lbl.gov) wrote:
: In article <1992Nov18.233739.2335@den.mmc.com>
: richard@crowded-house.den.mmc.com (Richard Armstrong) writes:
: >For instance, is the string a stored in the same place in the following
: >two declarations?:
: >static char a[]="ABC"
: >funca()
: >{
: >char a[]="ABC";
: >}
: 
: Neither of these is in fact a `string literal': in both cases the
: quoted strings are initializers for objects.  String literals are
: formed from quoted strings that appear in a value context, e.g.,
: 	char *p, *q;
: 	p = "ABC";
: 	q = "ABC";
:
: 	/* it is unspecified whether p == q */
: 
: Distinct objects, however, always compare unequal, thus the following
: strictly conformant program must print `0':
: 
Ok, *I'm* confused here. Does this mean that if I do something like:

 *p[1] = ' '; 

q will now point to "A C" ??
 or will the above assignment yield a SEGV? 
 or what? (I know probably what :)

To carry this on further, what if p and q are in different scope, but the 
same source file?


--

-Ted Scott          
tscott@ocsmd.ocs.com           I was told that I'm a P.C. person:
(301) 601-2252                               Politically Challenged, that is.
Newsgroups: comp.lang.c,comp.software-eng
From: leisner@wrc.xerox.com ( Marty Leisner)
Subject: Re: Wanted: Supported equivalent of FileMerge
Followup-To: comp.lang.c,comp.software-eng
Reply-To: leisner@eso.mc.xerox.com
Organization: Xerox
X-Newsreader: TIN [version 1.1 PL7]
Date: Fri, 20 Nov 1992 01:56:05 GMT

Doug Valkenaar (dougv@vnet.ibm.com) wrote:
: Does anyone know of a "FileMerge" type program which allows you to visually
: merge two files into a third one with selected parts from each of the
: originals?  SUN used to distribute such a program, but it's only SunView
: (I'd like OpenLook), and it's no longer supported.
: 
: Surely there's something like this in an 'X' or OpenLook GUI.
: 
: Thank you for your help.
: 
: ----------------------------------------------------------------------
: D. Douglas Valkenaar       ROLM PhoneMail         (dougv@vnet.ibm.com)
: ----------------------------------------------------------------------

Maybe look at GNU sdiff (in the diff-2.0 package)

GNU diff is quite impressive and has excellent and extensive documentation!! 
--
marty
leisner.henr801c@xerox.com  leisner@eso.mc.xerox.com
Member of the League for Programming Freedom
Newsgroups: comp.lang.c
From: blume@kastle.Princeton.EDU (Matthias Blume)
Subject: Re: the abs() function in C
Reply-To: blume@kastle.Princeton.EDU (Matthias Blume)
Organization: Dept. of Computer Science, Princeton University
Date: Sat, 21 Nov 1992 01:55:18 GMT

In article <maurer.722246649@magellan.stanford.edu>,
maurer@nova.stanford.edu (Michael Maurer) writes:
|> In <pebi.722223424@zephyr.aem.umn.edu> pebi@aem.umn.edu (Peter A.
Bidian) writes:
|> 
|> 
|> >Isn't abs(-2)=2 in C?
|> >I always get 0.

Please, show the full program text, where you encountered the problem.
Of course, abs(-2) should be 2.

|> 
|> >Confused!
|> 
|> >Peter
|> 
|> you probably want to say abs(-2.0), if the abs() function expects a
|> floating point argument.  or abs((double)-2).

abs is an int-function!  For doubles we've got fabs!

-Matthias
From: andrew@teslab.lab.oz.au (Andrew Phillips)
Newsgroups: comp.lang.c
Subject: Re: The Correct Way To Write C if-Statements
Date: 19 Nov 92 00:34:14 GMT
Organization: Technology Services, Chief Secretary's Dept, Sydney

mikey@ontek.com (euphausia superba) writes:
: [How a coding conventions should not be enforced because the style
: can be used to identify the author of the code.]

With the greatest respect, I submit that the style of code is a very
poor way of identifying an author.  Apart from the flaws that you
mention there is also no guarantee that the programmers will use
different styles or be aware of what other peoples styles are.  Is
there some problem with you compiler that it doesn't accept comments.

Proper use of a source code control system would allow you to
identify who wrote at least large chunks of code.  With very small
pieces there would not be enough to code to detect a style anyway.

My final question is, why do you need to know who wrote the code, if
it is well written and documented.  In a company I worked for it was
policy that the author of code NOT be identified.  This was to
encourage people to write code just to get the job done and not to
spend a lot of time writing code just to impress others.  Personally
I think there are valid reasons for needing to find who wrote a bit
of code.  Of course, this company is probably very different to yours
- having a high turnover of staff the chances were high that the
original author could not be located anyway.

As far as the advantages of code conventions goes I think that
readability can not be emphasized enough.  Not only does it save time
and frustration it can help avoid some nasty bugs.  And after all
most of us use some conventions which would otherwise make software
completely unreadable, although I have seen code like this:

f()
{
while (x)
{
i=10;
for (j=1; j<i; ++j)
  {
  if ()
  {  xxx;
     if ()
  {  yyy;
     }}
}
}}
-- 
Andrew Phillips (andrew@teslab.lab.oz.au) Phone +61 (Aust) 2 (Sydney) 287 6551
Newsgroups: comp.lang.c
From: chaplin@keinstr.uucp (Roger Chaplin)
Subject: Re: How to use make to create two different targets from the same sources
Organization: Keithley Instruments, Cleveland, Ohio
X-Newsreader: TIN [version 1.1 PL6]
Date: Wed, 18 Nov 1992 13:06:47 GMT

I tried to respond via email, but it bounced . . .

Roger E. Benz (reb@quintro.uucp) wrote:

In article <1992Nov10.220743.4479@quintro.uucp> Roger E. Benz
(reb@quintro.uucp) wrote:

: I would like to setup a Makefile that would allow me to create two
: different targets from the same source files.  Our primary target is
: a 68k embedded system for which we use a cross compiler.  During
: development, however, we find it useful to build test version using
: the native compiler.  Currently, I have to edit my Makefile to switch
: compilers and then run: make clean.  If anyone knows of an easier way to
: accomplish this, I would be most thankful.

I'm not sure how to eliminate the `make clean' step, but here's a
sample bit of Makefile, derived from the Makefile I used in a similar
situation (this is formatted with 4-space TAB stops - you probably
already know that make is very picky about having TABs instead of
SPACEs):

.primary:=	CC = mcc68k
.primary:=	CFLAGS = -aic -nQ -nKc -g -c

.test:=		CC = /usr/bin/cc
.test:=		CFLAGS = -c -O

primary:	$(SOURCES)
			$(CC) $(CFLAGS) $(SOURCES)

test:		$(SOURCES)
			$(CC) $(CFLAGS) $(SOURCES)


Notice that since `primary' is the first real target in the Makefile,
just running `make' will build it.  Make will perform the conditional
macro assignments based on the fact that target `primary' is being
built.  On the other hand, running `make test' will build the `test'
target.  In this case, make will perform the conditional macro
assignments in the lines that begin with `test:='.

Disclaimer: this is Sun's make; if you have a different make, it may
not have this capability.

-- 
Roger Chaplin / Instruments Division Engineering / "This land is your land,
chaplin@keinstr.uucp / CI$: 76307,3506          / This land is my land,
#include <disclaimer.h>                        / One of us has a bogus deed
#include "disclaimer.h" /* cover all bases */ / to this land."  - George Carlin
Newsgroups: comp.lang.c,comp.lang.c++
From: sailors@CS.ColoState.EDU (robert sailors)
Subject: Re: *** IMPORTANT DISCOVERY ***
Date: Fri, 20 Nov 1992 07:00:40 GMT
Organization: Colorado State University, Computer Science Department


Somebody got her/is newsgroups mixed up
From: hartman@ulogic.UUCP (Richard M. Hartman)
Newsgroups: comp.lang.c
Subject: Re: The Correct Way To Write C if-Statements
Date: 18 Nov 92 00:25:13 GMT
Organization: negligable

In article <3860@dozo.and.nl> jos@and.nl (Jos Horsmeier) writes:
>In article <1992Nov12.140710@gese.ge14.mdadv.gv.at> sca@gese.ge14.mdadv.gv.at (Petzi Schweda) writes:
>
>Well, I think it was Dennis M. Ritchie himself who did this, although
>I have seen BCPL programs, formatted like this. I find the Pascal like
>indentation style just a funny looking as the C like style they used in 
>the book `Software Engineering in Pascal'. It goes something like this:
>
>if I = TRUE then begin
>    J:= J+1;
>    I= FALSE
>end
>

The Grogono book (the standard when I learned this silly language)
did this:

    IF index < maxwordlen
        THEN
            BEGIN
                index := index + 1;
                word[index] := currentchar
            END;

( redundant indentation! )

When I actually used the language I did:

    if index < maxwordlen then
        begin
        index := index + 1;
        word[index] := currentchar;
        end;

Look familiar?

And we (C programmers) think we invented these arguments....        :)

        -Richard Hartman
        hartman@uLogic.COM

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Disco isn't dead...            ...it's just in witness protection!

From: John.Duke@f78.n130.z1.fidonet.org (John Duke)
Sender: FredGate@ocitor.fidonet
Newsgroups: comp.lang.c
Subject: Hey???
Date: Thu, 12 Nov 1992 21:24:46

Hey,
Haven't heard from you in a while, neither have I had a chance to be on your bbs in a while. What's new???  What's the deal with RODRIGUEZ being pulled  back on 04 Jan 93??? (This probably is not public and I would prefer to keep it that way.) Know any neat and current scuttlebutt??? Is there any security on this thing??? Can anybody get these messages??? Oh well.. Holler at me. By the way, what's the latest best price on a 486-50 motherboard with about 4mb ram? and will all my stuff work with it and






at's everything you know about the new 586 or whatever the numerical identifier they have on it is?

Leave a msg.
Later
DUKE
 

 * Origin: This Message Leached from CyberVille... (1:130/78)
From: gordo@phsbbs.princeton.nj.us (Gordon Davidescu)
Newsgroups: comp.lang.c
Subject: Ansi files
Date: Wed, 18 Nov 92 07:52:30 EST
Organization: Princeton High School, Princeton, New Jersey

I am currently making a game which shows ansi files every once in a 
while (like when you mess up in the game, when you quit, etc.)

The problem I am facing should be relatively simple.  I don't know how to 
show ansi files in the C/C++ environment.

Could anyone assist?
thanks

-----
Gordon Davidescu, Princeton High School BBS
DNS: gordo@phsbbs.princeton.nj.us      UUCP: ...!princeton!phsbbs!gordo
Disclaimer: Author bears full responsibility for this message.
Xref: sparky comp.lang.c:16615 comp.lang.c++:16376
From: bhoughto@sedona.intel.com (Blair P. Houghton)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: *** IMPORTANT DISCOVERY ***
Date: 16 Nov 1992 20:29:37 GMT
Organization: Intel Corp., Chandler, Arizona
NNTP-Posting-Host: alfalfa.intel.com

In article <1e216bINN5hd@matt.ksu.ksu.edu> danodom@matt.ksu.ksu.edu (Dan Odom) writes:
>What the hell was that?

Undefined behavior, if I'm reading the Standard (ANSI X3.159-1989) correctly.

				--Blair
				  "An issue of style,
				   at the very least..."
Newsgroups: comp.lang.c