HDTenEightyP/NetNews huggingface dataset:
From: david.brooks@cutting.hou.tx.us (David Brooks) 
Newsgroups: comp.lang.c
Subject: What went wrong?
Date: 17 Dec 92 22:30:00 GMT
Distribution: world
Organization: The Cutting Edge - Houston, TX - 713-466-1525
Reply-To: david.brooks@cutting.hou.tx.us (David Brooks) 

Many thanks to all who replied to my factorial problem. I actually figured
out that the problem was with the %d conversion character right after I
posted the message. I tried to get back and kill the post, but the access
number I use was busy.

Ever have one of those "Aha!" experiences right as you ask a stupid
question? I'm surprised you all didn't flame me to ashes!

Again, thanks for the replies!

   David

 * Q-Blue v0.7 [NR] *                                                                             
----
+---------------------------------------------------------------------+
| The Cutting Edge BBS (cutting.hou.tx.us)    A PCBoard 14.5a system  |
| Houston, Texas, USA    +1 713 466 1525          running uuPCB       |
+---------------------------------------------------------------------+
Newsgroups: comp.lang.c
From: cmick@silver.ucs.indiana.edu (Baldy)
Subject: Probably a simple question
Organization: Indiana University
Date: Sat, 19 Dec 1992 08:14:38 GMT

     This is propably a simple problem.  But I'm trying to write an invoice
type program for a friend.  I know how to read and write to a file but how
do you say save an invoice number, or a debit, credit amount, and then add
something to it.  I know how you get stuff from a file, but only character
by character, not integers that I can add + 1 to.
     If this makes sense, please help.

Thanks.
-- 
Later,
	Craig
cmick@silver.ucs.indiana.edu
cmick@acoma.ucs.indiana.edu
From: genius@tradent.wimsey.bc.ca (Michael Cooper)
Newsgroups: comp.lang.c
Subject: Interrupt-driven I/O
Date: Wed, 16 Dec 92 20:34:33 PST
Organization: TradeNET International Trade Corp.

I have seen several interrupt driven com I/O routines.  I am using 
Borland C++ v.3.1 and while looking through the Windows commands I 
noticed a built-in function for this.  What I am looking for is something 
which I can use for a BBS.  Right now I am experimenting with opening 
files and I have found that I can do things like vfprintf() and make my 
job a lot simpler by using variable-size argument lists.  Do you know of 
a function similar to the file openning thing but so that it writes 
anything that comes in to an array?  Well, hopefully you get the idea.  
If you have even a clue of what I am looking for, please E-Mail me.  
Thanks.

                                                        Michael Cooper
Newsgroups: comp.lang.c
From: alpha@waggen.twuug.com (Joe Wright)
Subject: Re: Problem
Organization: ALPHA, Box 68621, Va. Beach, VA 23455
X-Newsreader: TIN [version 1.1 PL6]
Date: Tue, 15 Dec 1992 20:23:43 GMT

Right out of the book:

	int c;
	while ((c = getchar()) != EOF)
		putchar(c);

-- 
Joe Wright  alpha@waggen.twuug.com  "Jose' can you C?"
From: curry@hplred.HPL.HP.COM (Bo Curry)
Date: Tue, 15 Dec 1992 02:21:58 GMT
Subject: Pointer to Function Question
Organization: Hewlett-Packard Laboratories, Palo Alto, CA
Newsgroups: comp.lang.c

I have a pointer-to-function question which is baffling me. Perhaps one
of the gurus out there has the answer?

typedef struct {
	void (* displayit)(struct _WINDOW *);
} DISPLAYTYPE;

static void ShowMyPanes(struct _WINDOW *);

int Testit ()
{
	DISPLAYTYPE mypanes;

	mypanes.displayit= ShowMyPanes;
        
	...
}

My compilers, both the HPUX ANSI c89 (8.54) and Microsoft 7.0, complain that
the "Pointers are not assignment-compatible". The code seems correct, and
works OK. If the argument of the assigned function is int, or (void *),
they don't complain, only if it is (struct x *).

Any advice, explanations, or gentle instruction would be appreciated.

Thanks,

Bo Curry
curry@hplabs.hpl.hp.com
Newsgroups: comp.lang.c
From: jinl@csri.toronto.edu (Jin Liu)
Subject: Does any one know about c-tree /r-tree ?
Organization: CSRI, University of Toronto
Date: 18 Dec 92 21:33:58 GMT


   Hi, has any one used CTREE or RTREE package (I'm using c-tree
   Plus ver.6.0)?  To build a database, basically there are two ways,
   one is with Lowlevel functions, the other is with ISAM functions.
   I noticed they are quite memory consuming. I thought Lowlevel function
   taking less memory compared with ISAM functions (and i compared the
   given sample program by FairCom, the isam.c and lowlevel.c). But
   i'm still not so sure, Some one else was using ISAM and they thought
   ISAM function requiring less memory than Lowlevel function.

   Does any one have the same problem or has some knowledgee regarding
   this? Generally, what's the min. memory requirment for C-tree
   /or R-tree (the FairCom's guild doesn't say a thing about it).
   Any help/suggestions/advices will be highly appreciated.


   Jin Liu

   Email: jinl@csri.torotno.edu.        Tokyo Electric Canada Co Ltd.

   * *  Teamwork is essential -- it allows you to blame someone else :-) * *
Newsgroups: comp.lang.c,comp.lang.c++,comp.misc
From: rmartin@thor.Rational.COM (Bob Martin)
Subject: Re: What is Object Oriented Programming? Is C doomed?
Organization: Rational
Date: Tue, 15 Dec 1992 13:11:04 GMT

kdq@quest.UUCP (Kevin D. Quitt) writes:

>hartman@ulogic.UUCP (Richard M. Hartman) writes:
>> 
>> OOP and C++ is NOT a "silver bullet", any more than "structured programming"
>> was.  It is a new tool that gives us the potential for things that were
>> more difficult before, but in and of itself does NOTHING.  That is the
>> job of the software designer.  If it is done poorly, it is done poorly
>> no matter what the language or paradigm.

Well said.


>    This is the heart of the matter:  OOP is another device which
>helps mediocre programmers to produce good code.  Good programmers can
>also make use of it, but they've *always* produced good code.

No, I disagree with this.  OOP is best used by the "good" programmers.
THey will be the most able to appreciate it and take advantage of its
facilities.  I think OO will provide far more benefits for the "good"
programmer, than for the "mediocre" programmer.

I don't think any tool, or methodology can be used to force
"mediocre" programmers to create "good" code.  "Mediocre" programmers
produce "mediocre" code by definition.  A better tool isn't going to
change that.

I also disagree that "Good" programmers had "always produced good
code."  Good programmers are programmers that continue to learn
throughout their carreer.  Mediocre programmers are those who reach a
plateau, assume that have "made it", consider themsevles to be "good",
and stop learning.  Truely good programmers should be looking back at
the code they produced last year, or th year before, and be able to
find flaws with it, based on what they have learned since then.

IMHO...

--
Robert Martin                        Training courses offered in:
R. C. M. Consulting                       Object Oriented Analysis
2080 Cranbrook Rd.                        Object Oriented Design
Green Oaks, Il 60048 (708) 918-1004       C++
Newsgroups: comp.lang.c
From: jhurwitz@access.digex.com (j. hurwitz)
Subject: Problems with Case statements HELP!
Keywords: case help lost c not
Organization: Express Access Online Communications, Greenbelt, MD USA
Distribution: usa
Date: Thu, 10 Dec 1992 07:24:09 GMT


Okay, I'm new to C so you'll have to forgive my lame question. Anyhoot,
I'm trying to write a program that will check for balanced braces in my
C source code. I have no problem when I do this:

=========================== Begin Hack =============================
//programm to read a C source file and verify # of left to right braces

#include <stdio.h>
int main(int argc, char *argv[])
{
   FILE *fptr;
   int l=0, r=0;
   char ch;

   fptr  = fopen("brachek2.c","r");

   while ((ch =getc(fptr)) !=EOF)      //gets chars
   {
   if(ch=='{') l++;
   if(ch=='}') r++;
   }
   if (l != r)
  printf("\nBraces do not match\n");
   else printf("\nBraces match !!!\n");
   fclose(fptr);
 }
=========================== End Hack ===============================

But, when I try this:

============================== Begin Hack =========================
//programm to read a C source file and verify # of left to right braces

#include <stdio.h>
int main(int argc, char *argv[])
{
   FILE *fptr;
   int l=0, r=0;
   char ch;

   fptr  = fopen("brachek3.c","r");
   while ((ch =getc(fptr)) !=EOF)      
   {
   switch (ch)
     {
     case '{':  l++; 
     case '}':  r++; 
     }
   }
   printf("\nl= %d r= %d", l, r);
   if (l != r)
   printf("\nBraces do not match\n");
   else printf("\nBrace match !!!\n");
   fclose(fptr);
}
================================ End Hack ========================
I get an uneven number of braces at the end. I can't figure out what
I am doing wrong. I'm sure it is a minor oversight on my part. Any help
would be greatly appreciated
 



          __/ /          .                     +             .
        _/__/_/\                                
      _/____/ \/  J. Hurwitz                                          ,
  .  /     / \/|          .          *                   
    /     /  /|/  The MIDI master             .                  o
   /_____/  / |                                         
  //____/\\/ /  Roaming Cyberspace          "Space is the place"        
  /  o  \ ||/    .                     
 | o   o |//                                .          -Sun Ra      +
  \o   o//     jhurwitz@access.digex.com          
   --^--   .                                            *        
+                         '               +
From: devido-antonio@cs.yale.edu (Antonio DeVido)
Newsgroups: comp.lang.c
Subject: nr.h
Date: 12 Dec 1992 14:52:11 -0500
Organization: Yale University Computer Science Dept., New Haven, CT 06520-2158
Distribution: world
NNTP-Posting-Host: grizzly.zoo.cs.yale.edu

greetings,
I have a copy of the book, but I was wondering if s/o could provide me with just the two header files "nr.h" and "nrutil.h" for Press, Teukolsky et al. to
turn my grey day into a productive one. I used to have them, but dont
seem to have saved them.
Thanks,
Antonio
-- 
Antonio J. De Vido // devido@cs.yale.edu   // league@prep.ai.mit.edu
From: apn@Apple.COM (Alex Novickis)
Newsgroups: comp.lang.c
Subject: Re: real time graphics c libraries
Keywords: graphics
Date: 20 Dec 92 00:01:07 GMT
Organization: Apple Computer Inc, Cupertino, CA

In article <4632@copper.Denver.Colorado.EDU> ssarmast@copper.denver.colorado.edu (Sam Sarmast) writes:
>
>I'm in the process of having to write a package that will
>show on the screen 3 windows which contain some sinusiodal 
>signal scrolling from right to left (i.e. like a scope).
>
>Anyone know of a package that will do something like this?
>
>I'm looking for either commercial or shareware packages.
>
>thanks.
>
>sam

For DOS ? MS-Windows ? X ? _What_ ?

If you need other scope like functions besides just displaying try:

LabView is available for Windows, MACOS, and SUN from 
national instruments
They also have labwindows for DOS which is much simpler.

There's also some lab display type stuff from a company called 
"Strawberry Tree ?" or somesuch.




If you need something fast, though, I would write it from scratch


-- 
Alex P. Novickis, Real Time systems demi-guru.  (W)   408-862-4541
ALINK:alex.n                                    (H)   415-691-0657
UUCP:{amdahl,claris,pyramid,sun,decwrl,well,ubvax,ames}!apn@apple.com,apn@nonvon
"I think... I think it's in my basement. Let me go upstairs and check"-Escher.
Newsgroups: comp.lang.c
From: jar@solva.ifi.uio.no (Jo Are Rosland)
Subject: Re: array of file pointer ?
X-Md4-Signature: 4a3754deb772f4387c2b9d32dd71ceed
Organization: Dept. of Informatics, University of Oslo, Norway
Date: Wed, 16 Dec 1992 14:40:44 GMT
Originator: jar@solva.ifi.uio.no

In article <1992Dec16.021738.2599@mtu.edu> kjlee@mtu.edu (KONG-JIN  LEE) writes:

   Does anyone know how to declare an array of file pointer in GCC

   I have tried :

   FILE *filptr[10];

   ???? ---> is this ok ?  FILE **filptr;
   if (0k)

   then ??? ---> filptr = malloc(10*sizeof(FILE));
	??? ---> *(filptr+10) = fopen(......); 

Close, but not quite.  You need to do it like this:

       filptr = (FILE **)malloc(10 * sizeof(FILE *))
       *(filptr + 9) = fopen(......);

This has three differences from your original suggestion:

1. The return value from malloc is cast'ed to the type it's
   supposed to have.

2. You want to make an array of FILE * instead of FILE, hence
   use FILE * inside sizeof.

3. filptr + 10 points beyond the end of the memory allocated by
   malloc, while filptr + 9 points to the last element.

And last, instead of the second line you can equally well write:

       filptr[9] = fopen(......);

--
Jo Are Rosland
jar@ifi.uio.no
Xref: sparky comp.lang.c:18305 comp.lang.c++:17905 comp.lang.misc:4025 comp.org.ieee:593 comp.programming:3318 rec.games.programmer:5025 rec.games.xtank.programmer:630
From: anandm@ccwf.cc.utexas.edu (Anand Mandapati)
Newsgroups: comp.lang.c,comp.lang.c++,comp.lang.misc,comp.org.ieee,comp.programming,rec.games.programmer,rec.games.xtank.programmer
Subject: Texas State Programming Contest - Feb. 6, 1993
Date: 14 Dec 92 04:43:09 GMT
Reply-To: anandm@ccwf.cc.utexas.edu (Anand Mandapati)
Followup-To: comp.org.ieee
Distribution: tx
Organization: The University of Texas at Austin, Austin TX
Originator: anandm@dewey.cc.utexas.edu


Ha!  The rogue spider fell into my trap.  He had spun a line from his
web to mine and was moving along it, salivating at the flies I had
left as bait.  I cut the line and laughed as he plummeted to the
ground.  I quickly moved to eat the flies on his unprotected web,
winning the game to the delight of a few programmers clustered around
a computer monitor...

The last IEEE CS State Programming Contest was a great success.
Players wrote programs to control spiders which battled to eat the
most flies in a time limit.  The program featured real-time playing
and fantastic graphics.  This year's contest promises to be even
better.  The Eleventh IEEE CS Texas State Programming Contest will be
on Saturday, February 6, 1993.  We will again feature real-time
playing, graphics that will make your head spin, and sound that will
make your ears spin (maybe).  Also we will have some nice prizes.

Teams compete by writing player-programs that battle each other inside
the game-world we have created.  In previous semesters programs have
been written to control snakes, submarines, tanks, and spiders.  Our
contest rewards clever algorithms, not technical knowledge of the PC.
We have written all the support routines; you have to write the brains
of the players.

We are now accepting registration for two and three person teams from
universities other than UT.  (UT Teams register during the first week
of the spring semester.)  If you are interested in participating send
mail to anandm@ccwf.cc.utexas.edu.

Act quickly.  We have space for about 22 teams.  We reserve the right
to reject a team because of space limitations or to limit the number
of teams from any one university.  Plan on spending the entire day at
UT; the contest will last from about 9am-6pm.

-- 
------------------------------------------------------
Anand "I can't come up with anything funny!" Mandapati
anandm@ccwf.cc.utexas.edu  ||  anand@milo.amd.com
------------------------------------------------------
From: ugo@oliver.sublink.org (Ugo Cei)
Newsgroups: comp.lang.c,comp.unix.ultrix,comp.unix.programmer
Subject: Re: Error using strftime om Ultrix 4.2??
Date: 12 Dec 92 13:16:06 GMT
Organization: Oliver System - Pavia ITALY

yhtao@magnus.acs.ohio-state.edu (Yu-Hui Tao) writes:

>  struct tm timenow;

>	strftime(ntime, 26, "%h %d %H:%M:%S %Y", timenow);
                                                 ~~~~~~~

You need to put the *address* of ``timenow'' there, i.e. ``& timenow''.

-- 
Ugo Cei --- Via Colombo 7 - 27100 Pavia - ITALY   |
         -- Sublink:  ugo@oliver.sublink.org      | "Real programs dump core"
Newsgroups: comp.lang.c
From: oz@ursa.sis.yorku.ca (Ozan Yigit)
Subject: Re: Need good hashing functions
Organization: York U. Student Information Systems Project
	<27911@dog.ee.lbl.gov> <OZ.92Dec14115806@ursa.sis.yorku.ca>
Date: Mon, 14 Dec 1992 21:15:14 GMT

I wrote

   Alternatively, one can use an algorithm that expands without re-hashing
								---------
this should read					...     copying

Torek's expansion algorithm does not re-hash, but copies the entire table.

oz
Newsgroups: comp.lang.c,gnu.gcc.help
From: mroussel@alchemy.chem.utoronto.ca (Marc Roussel)
Subject: Compiler math (Was: How precise is preprocessor math? (I'm using gcc))
Organization: Department of Chemistry, University of Toronto
Date: Fri, 18 Dec 1992 16:07:06 GMT

In article <1992Dec18.104956.11433@flood.com> tom@flood.com (Tom Chatt) writes:
>If Chris Volpe was suggesting the more limited proposition that
>certain standard calls, such as sin(), are "known" to the compiler,
>that's plausible, but still seems dubious. "sin" is not a resrved
>word in C, and nothing would prevent me from writing my own "sin()"
>routine which did something completely different.

     Someone pointed out to me in a similar conversation a little while
ago that in fact, according to the standard, once you include certain
standard header files, you are in fact reserving new blocks of
identifiers.  For instance, once you have included math.h, sin becomes a
reserved word with well-defined semantics.  The compiler is allowed to
do whatever it wants with sin(x) so long as the result in
indistinguishable at run-time from what the standard specifies as the
correct behaviour.  The compiler is thus perfectly well within its
rights to evaluate sin(1.0) at compile time (as long as math.h was
included).  Most Fortran compilers are capable of something like this,
and I would be very surprised if C compilers weren't capable of it too.

				Marc R. Roussel
                                mroussel@alchemy.chem.utoronto.ca
From: 5652garsidej@vms.csd.mu.edu
Newsgroups: comp.lang.c
Subject: Writing and reading from a device
Date: 18 Dec 1992 02:56:01 GMT
Organization: Marquette University - Computer Services
Reply-To: 5652garsidej@vms.csd.mu.edu
NNTP-Posting-Host: vmsd.csd.mu.edu

Hi,
   I am trying to write a simple communication program that will basically
read and write to a port that a modem is connected to (not quite fortunate
to have tcp/ip yet).  The problem is that when I echo the output, not all
of it is released by the buffer.  I am using SCOV5.  Any suggestions?  Also,
if anyone has some source code to get me started, that would be great.
Thanks...
jg
From: droelke@spirit.aud.alcatel.com (Daniel R. Oelke)
Newsgroups: comp.lang.c
Subject: TSR sources : request
Date: 17 Dec 92 19:54:54 GMT
Organization: UTexas Mail-to-News Gateway
NNTP-Posting-Host: cs.utexas.edu

> The name of that group is TeSeRact.

This product is shareware and is now owned by IDC (can't remember the acronym
offhand).  They have quite a list of products for developement of user 
interfaces in C - lots of functions for doing all kinds of windowing
environments.  The product is moderately good, and was relatively cheap,
but has been getting more expensive for what you get.

Anyways, they can be reaced at:
      76702.1361@CompuServe.COM   
This is the address for Chip Rabinowitz, who is primarily there for 
technical support, but can direct you to the proper email address.
They also have an 800 number order line that you can call to get on their 
mailing list, but I don't have that handy.

-----------------------------------_---_--------------------------------------
Dan Oelke                         / \ / \              Alcatel Network Systems
droelke@aud.alcatel.com           \  V  /                       Richardson, TX
Phone: (214) 996-5013              \VMS/             #include <std-disclaim.h>
  Fax: (214) 996-7119               \ / 
-------------------------------------V----------------------------------------
From: alane@wozzle.linet.org (J. Alan Eldridge)
Newsgroups: comp.lang.c
Subject: Re: Unsigned Char -> 00100110
Date: 13 Dec 92 17:45:20 GMT
Organization: Disorganization

rob@sound.demon.co.uk (Robert J Barth) writes:

> OK, so I'm lazy...
> How do I convert an unsigned char into it's 8 bits ?
> I want to end up with an output of e.g. 00101101 

void OutBin(FILE *pf, unsigned char uc)
{
    int  i;
    char sz[ 9 ];

    sz[ 8 ] = 0;

    for (i = 7; i >= 0; i--) {
        sz[ i ] = '0' + (uc & 1); 
        uc = uc >> 1;
    }

    fprintf(pf, "%s", sz);
}

Since this took me less than one minute to write, yeah, you are lazy.
But I hope it helps you out, anyway.  

alane@wozzle.linet.org (J. Alan Eldridge)
Fido: The University of Walamaloo 1:272/38.473
From: surendar@elm (Surendar C.)
Newsgroups: comp.lang.c
Subject: Re: curses.h  dirent.h
Date: 15 Dec 1992 08:11:10 GMT
Organization: Worcester Polytechnic Institute, Worcester MA 01609, USA.
Distribution: usa
Reply-To: surendar@wpi.wpi.edu
NNTP-Posting-Host: elm.wpi.edu
X-Newsreader: TIN [version 1.1 PL8]

: 'curses.h':

: Is it possible to be able to read and process a character without writing
: that character to the screen?  I've tried getch(), and although I'm able to
: process a character right away (as opposed to waiting for the enter key to
: be pressed), the character is printed to the screen.

You may want to set noecho() first.

Thanks
surendar
Newsgroups: comp.lang.c
From: u920496@daimi.aau.dk (Hans Erik Martino Hansen)
Subject: array initialisation
Keywords: c,array,initialize,bla bla
Organization: DAIMI: Computer Science Department, Aarhus University, Denmark
Date: Fri, 18 Dec 92 13:52:55 GMT

Hello outthere in netland!

In a program a friend is writing he needs an array of an array of ints.
The number of elements is not fixed.

This is how I would write the source:
/* example.c */
int **tank = {
	{ 10,24,563,3245,234,52345,234,-1 },
	{ 1,645,21,-1 },
	{ 243,33,452,122,422,123,-1 }
};
...

I cannot make the compiler accept "example.c". But if I change the definition
of tank to: int tank[][8] = ... it works fine. But I think this solution
is ugly code, and definately not according to the spirit of C. 
Some of the elements could be very long, and some consist only of a few
ints. Then a lot of unused memery is allocated, and even more important:
you'll have to count the elements by hand.

My question is simply: is there a way to do, what I intended to in example.c

Please mail me directly, as I have no access to newsgroups during the
holiday. Thanks in advance!

Erik Martino Hansen  | u920496@daimi.aau.dk
Trige Parkvej 9,ST1  | 
DK-8380  Trige       | "Information wants to be free!"
Denmark              |
Newsgroups: comp.lang.c
From: vasco@jessica.bvl.pt (Antonio Vasconcelos)
Subject: Re: A_REVERSE in curses???
Reply-To: vasco@jessica.bvl.pt (Antonio Vasconcelos)
Organization: Bolsa de Valores de Lisboa 
Date: Fri, 11 Dec 1992 12:29:50 GMT

 sjs@netcom.com (Stephen Schow) writes:
)I need help with curses.  I wrote a little test program that works great on
)one UNIX box.  When I try to compile it on another UNIX box (at netcom) it
)failes to recognize the A_REVERSE macro definition, which I had pressumed
)was a standard thing.  Is it a standard thing?

Take a look at file /usr/include/curses.h, probably the names have been changed
on your implementation, I think IBM did that in AIX 3.1.5.

regards,

|/asco