HDTenEightyP/NetNews huggingface dataset:
From: pt@geovision.gvc.com (Paul Tomblin)
Newsgroups: comp.lang.c
Subject: Re: New Comer - Please Help !
Date: 27 Aug 92 13:39:08 GMT
Reply-To: pt@geovision.gvc.com
Organization: Not officially GeoVision Systems Inc., Ottawa, Ontario

gilpin@iscsvax.uni.edu writes:

>  I don't know about your situations, but at my university the site license
>with Borland allows anybody on campus to run any of the Borland compilers
>(either on networks, or on stand-alone micros).  The manuals, however, cost
>extra.  I don't teach programming using C, but if I did I think I would

If that's the case, then I apologize for making a wrong assumption.
However, I _still_ think that in a case like that the person using the
compiler should have at least a nodding aquaintance with the manual
set, and should be able to peruse them at some global area, like a
library.  There is no excuse for not RTFMing.  If there isn't one
manual set available where anybody who has a site-license copy can read
it, then you are doing your students a real disservice by having a
site-licence.

-- 
Paul Tomblin, pt@geovision.gvc.com or {uunet,revcan}!geovision!pt
(This is not an official opinion of GeoVision Systems Inc.)
Zen T-Shirt: Enlightenment Available - Enquire Within
 -- Paul Gillingwater (Paul.Gillingwater@actrix.gen.nz) on rec.humor.funny
Xref: sparky comp.lang.c:12827 comp.unix.questions:10417
From: atmtjkv@vax.oxford.ac.uk
Newsgroups: comp.lang.c,comp.unix.questions
Subject: Re: cursor input on curses (new prob.)
Date: 26 Aug 92 07:21:12 GMT
Organization: Oxford University VAX 6620

In article <1992Aug25.220112.1@hamp.hampshire.edu>, jmolinari@hamp.hampshire.edu writes:
> 
> 	A while ago I posted a question dealing with the curses library
> package.  I asked how I could handle cursor input, e.g., "cursor-up, down,
> etc."  Several people replied with variations of "use the keypad() function".
> Problem is, keypad() doesn't seem to be implemented in our package of curses
> (which is installed on a sun3 system).  It's not in the curses.h file, nor in
> any of ther OTHER headers in our collection (I GREPped the directory, so I'm at
> quite a loss.  If anybody can explain this and/or offer a solution, I will be
> able to finish an ascii version of Minesweeper I'm working on for school.
> Thank you!
> 			jmolinari@hamp.hampshire.edu

It's a tricky problem.  To be really portable and terminal
independent, you have to parse the keystrokes and compare them
with the values given in TERMCAP or its equivalent.  I haven't seen
a version of curses that includes this, and most termcap files have
*very* scanty information about key codes, particularly for function keys --
they normally stop with up, down, left and right.  I have a routine to 
do this parsing, and some fuller termcap entries, if you're interested.
It reads the termcap file at run time, so it can cope with changes of
terminal type.

-- 
Tim Kingsmill-Vellacott
Atmospheric, Oceanic and Planetary Physics
University of Oxford, UK.
tjkv@atm.ox.ac.uk  preferred
Newsgroups: comp.lang.c
From: suthan@cs.hw.ac.uk (Manickam Umasuthan)
Newsgroups: comp.lang.c
Subject: c<->fortran
Date: 30 Aug 92 11:25:32 GMT
Organization: Dept of Computer Science, Heriot-Watt University, Scotland

Dear Netters,
I tried the following piece of code which interfaces with a fortran routine
which in turn uses the EXTERNAL statement and the external function is defined
in C. But in my machine the output is wrong. I like to know where the error
is.
Thanks . PLEASE EMAIL ME. 
-------------
#include <stdio.h>
#include <math.h>

float *abs();
main()
{
float y=-2.34;
start_((float (*)())abs,&y);
}
float *abs(t)
float *t;
{
float x;
	printf("LALA\n");
	x = 2.* (*t);
	printf("%f\n",x);
	return &x;
}
	subroutine  start(fname,x)
	EXTERNAL fname
	real x
	print*, fname(x)
	END
	-----------------------------
-- 
-------
M.Umasuthan, 				:: EMAIL:  suthan@uk.ac.hw.cs
Dept. of Computing & Electrical Engineering,
Heriot-Watt University, Riccarton, Edinburgh EH14 4AS, U.K.
From: qding@uoft02.utoledo.edu
Newsgroups: comp.lang.c
Subject: Help: Pascal --> C translator
Date: 30 Aug 92 05:10:57 EST
Organization: University of Toledo, Computer Services

Hi, there.

I am a C/C++ programmer. Recently I have a lot Pascal codes need to be 
translated to C/C++. Can anyone tell me where I can find any product 
which does Pascal --> C translating please? I downloaded one from 
simtel20. But it does not translate WITH. I would like to know anywhere
else I can download one better than this. 

Thanks in advance.

--- Rui

Newsgroups: comp.lang.c
From: jlnance@eos.ncsu.edu (JAMES LEWIS NANCE)
Subject: Re: True Portability?
Originator: jlnance@volt.ece.ncsu.edu
Reply-To: jlnance@eos.ncsu.edu (JAMES LEWIS NANCE)
Organization: North Carolina State University, Project Eos
Date: Thu, 3 Sep 1992 11:59:00 GMT


In article <1992Sep2.131333.540@wam.umd.edu>, krc@wam.umd.edu (Kevin R. Coombes) writes:
|> 
|> fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
|> >jlnance@eos.ncsu.edu (JAMES LEWIS NANCE) writes:
|> >>
|> >>If you write binary files and expect to share these between machines,
|> >>or if you use network connections between machines, then you have to
|> >>wory about wheather a machine is big or little endian, but if you
|> >>explicitly take this into account, you can still be portable.
|> >
|> >No, you won't.
|> >Basically binary files are not portable.
|> >(Code to read/write binary files can be portable, but the files themselves
|> >are not.)
|> >
|> 
|> I'm not sure I understand this statement. Yesterday I transferred some
|> DVI files (produced by TeX) and some MAT files (produced by Matlab)
|> from my Sun at work to my PC at home. I was still able to print the
|> DVI files, and to load the MAT files and continue my computations.
|> 
|> Both those files are binary data files used by the programs I mentioned.
|> Clearly, they are portable, since implementations of the software for
|> different platforms can both use them. Yes, the software has to be ported
|> as well; that's not in question. Could you elaborate on what you mean
|> when you say that binary files are not portable?
|> 
|> Kevin Coombes <krc@math.umd.edu>
|> 

When a computer stores an interger or a double or any type other than a char,
there are many ways it can represent this data.  Of particular importance is
wheather it stores the most or least signifigant byte of a number first, and
how many bytes it uses to represent a number.  These formats are not standard
and vary from machine to machine.  If you write a binary file which consists of
the bytes that make up an integer or a double or whatever, when you read them
back in on a different machine, they may not have the same meaning as they did 
on the machine you wrote them out on.  This is what is ment by binary files not
being portable.

Jim Nance
Newsgroups: comp.lang.c
From: KSZ@VM.NRC.CA
Subject: How to fprintf two columns?
Organization: National Research Council
Date: Wed, 26 Aug 92 13:26:40 EDT

I need the following output to a file:
                    1.2     2.3
                    1.3     2.4
                    1.4     2.5
                      ....
which contains two columns. They are not generated at the same time, i.e.
at the first the first column is generated and then write to a file. then
the file is rewinded and the second column is generated. Now I need write
the second column to that particular place, say begin with 10th column.
I have tried fseek() but it  seems to me not working. (?)
 
I have spent all day long and still don't see the light. Anybody can help me?
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 KAIJUN S. ZHAN                          || (613) 990 - 0734 (voice)
 Internet:ksz@vm.nrc.ca                  ||
 Internet:kzhan@sgi1.mathstat.uoguelph.ca|| "Three generates everything".
 Internet:gilwf16@vm.uoguelph.ca         ||
 Bitnet:ksz@nrcvm01                      ||      -- Lao Zhi
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.lang.c
Subject: Re: strcpy implementation question
Date: 4 Sep 1992 19:24:29 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: telecaster.think.com

In article <PINKAS.92Sep3173643@skywalker.intel.com> pinkas@skywalker.intel.com (Israel Pinkas) writes:
>Uninitialized memory belongs to the process, it just doesn't have a known
>or predictable value.  It is still legal to access it.

No, it isn't.  Accessing an indeterminately valued object has undefined
behavior (see the definition of "undefined" in the Introduction section of
the standard).  This allows for implementations that detect use of
uninitialized variables.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.lang.c
Subject: Re: main()
Date: 3 Sep 92 07:33:30 GMT
Organization: Comp Sci, RMIT, Melbourne, Australia

In article <cee1.715416182@Isis.MsState.Edu>, cee1@ra.msstate.edu (Charles Evans) writes:
> int main(void)
Fine
> void main(void)
Illegal.  The returntype of main ***MUST*** be "int", not "void".
Legal headers for main()

	main() {...}
	main(void) { ...}
	main(argc, argv) int argc; char **argv; { ... }
	main(int argc, char **argv) { ... }
	int main() { ...}
	int main(void) { ... }
	int main(argc, argv) int argc; char **argv; { ... }	/* + */
	int main(int argc, char **argv) { ... }

> BC++ books say int main(void) but what is the benefit of 'return 0' at the
> end.. seems like wasted space.

Well, it should really be "return EXIT_SUCCESS".  It's not wasted space;

> 
> Now in VERY new C++ books or VERY new C books, they usually have either
> 
> int main()
> or void main()

Books which tell you to write "void main()" are not to be discarded lightly,
they are to be hurled with great force.  Demand your money back.

/* + */ This is the one I use now.  It is legal Classic C and correct ANSI C
and it shuts picky compilers up.

-- 
You can lie with statistics ... but not to a statistician.
Newsgroups: comp.lang.c
Subject: Benchmark programs
From: jpecore@vitro.com (Joe Pecore)
Date: 25 Aug 92 15:01:18 -0500
Reply-To: jpecore@vitro.com
Distribution: world
Organization: Sun Microsystems, Inc.
Keywords: benchmark

Are there any standard benchmark programs for evaluating C compilers? 
Or better yet, are there any current reports on C compiler evaluations?

joe pecore
vitro corporation
jpecore@vitro.com
From: JENNIFER@TOROLAB6.VNET.IBM.COM ("Jennifer Hamilton")
Newsgroups: comp.lang.c
Subject: ANSI description for signal handling
Date: 31 Aug 92 14:58:49 GMT

In the ANSI standard under the description of the signal function,
(section 4.7.1.1) it states the following:

   "The function func may terminate by executing a return statement or
   by calling the abort, exit, or longjmp functions.  If func executes a
   return statement and the value of sig was SIGFPE or any other
   implementation-defined value corresponding to a computational
   exception, the behaviour is undefined.  Otherwise, the program will
   resume execution at the point it was interrupted.  If the signal
   occurs other than as the result of calling the abort or raise
   function, the behaviour is undefined if the signal handler calls any
   function in the standard library other than the signal function
   itself ..."

The last sentence implies that you can't call any library functions
(such as longjmp, abort or exit) from within the signal handler unless
the signal was explicitly raised through raise or abort.  But the first
three sentences imply that you can.  Can anyone explain this apparent
contradiction?

Jennifer Hamilton
IBM Toronto Lab
jennifer@torolab6.vnet.ibm.com
From: harrison@lclark.edu (Mark Harrison)
Newsgroups: comp.lang.c
Subject: Re: main()
Date: 3 Sep 92 18:42:56 GMT
Article-I.D.: lclark.1992Sep3.184256.18421
Organization: Lewis & Clark College, Portland OR

In article <1383@uknet.ac.uk> tlg@uknet.ac.uk (Tim.Goodwin) writes:
>In article <1992Sep3.160001.13782@lclark.edu> harrison@lclark.edu
>(Mark Harrison) writes:
>>                                                                OK.  I now
>>understand why it is important not to declare 'void main()'.  I never
>>thought of it before.  But two people have now told me to try it with -A
>>and -P.  Why?  I don't really need to satisify my curiosity about 'void
>>main()'.  So is there another reason I would want these switches?
>
>It seems that the readers of this group are interested in C, as defined by
>the ANSI/ISO standard, and not in other languages which happen to look
>like C (as, for example, the language which your compiler compiles).

That's fine.  I was just wondering why I should use the switches.  It
sounds to me like it's just to be officially correct.  Well I'm just
interested in writing a stable program for DOS machines.  I don't care if
the things I do aren't in the ANSI standards, as long as it is a good
program (i.e. using 'void main()' wouldn't be.)

>
>There are some, perhaps, who are overkeen to correct those who do not share
>this fascination with the standard.  But they are not trying to "score a
>point off you", merely attempting to disseminate accurate information.
>Many of them are the same people whose posts make this a worthwhile group
>to read.

That's fine.  I want accurate information.  Then I can decide how to apply
it.  That's also why I read this group.

>
>>                                                                   My
>>program would most definatly not be portable.  I'm writing a GUI for DOS
>>and I doubt that it would run without major modifications on another
>>system.  And I am very happy with Borland's product, and don't see myself
>>switching in the near future. 
>
>Not even to the next release of the compiler?  Unless this is a documented
>extension, you should not rely on it.  [ Damn - I'm doing it myself now.
>This should not be taken to mean that my posts contribute to the quality of
>the group :-). ]

Sorry, I meant that I wouldn't try to port the GUI stuff to unix or a mac,
or whatever.  I am trying to keep it pretty much portable as far as
compiler versions go.  Even between DOS compilers as much as possible,
although as I said, I probably won't be switching.

Sorry for my last post.  I almost died when I saw that mess.  I was late
for a staff meeting, and didn't notice what my editor did to it.

>
>Tim.


-- 
=============================================================================
Mark Harrison           |  "We are the Priests, of the Temples of Syrinx
harrison@sun.lclark.edu |   Our great computers fill the hallowed halls."
              -- Me     |                                    -- Rush
From: sbgros@skcla.monsanto.com
Newsgroups: comp.lang.c
Subject: text on graphics help
Date: 28 Aug 92 10:37:36 GMT
Article-I.D.: skcla.1992Aug28.103736.1
Organization: Searle, Skokie, IL
Nntp-Posting-User: heszar

I need help with text on a graphics screen.  I'm using turbo C.
the problem is, I have a counter on the screen that is in the thousand'th
of seconds. when the number changes it writes directly over the current 
number, not erasing the old number making an awful mess.  How do I 
do this without making it flicker.  Or, I'm using different fonts,
thats why I'm using graphics mode, is the a way to have different fonts
in text mode.
   please send me mail.  I'll post answer later  I promise!!

Scott Gross
sbgros@monsanto.com

thanks !!!!!
Newsgroups: comp.lang.c
From: takriti@engin.umich.edu (samer Takriti)
Subject: Re: Why should POINTERS be so damn hard to understand ?
Date: Thu, 27 Aug 92 10:22:18 EDT
Organization: University of Michigan Engineering, Ann Arbor

In article <1992Aug27.135946.6622@infonode.ingr.com> henders@infonode.ingr.com (Greg Henderson) writes:
>chas@castle.ed.ac.uk (C Spencer) writes:
>
>>Why does a pointer need to know what it's pointing to? Surely it's just
>>an address - if there was only one kind of pointer, there wouldn't be so
>>much to learn, and be confused by.
>
>Well one reason that pops to mind is the nice ability to use a pointer 
>to traverse an array more efficently than the 'normal' way.  For ex...
>
>You could do this normally:
>{
>    int a[1000], i; 
>
>    for ( i=0; i<1000; i++ )
>	a[i] = get_some_arbitrary_value();
>}
>
>Or you could do this w/ a pointer:
>{
>    int a[1000], *_i;
>
>    for (_i=a;  _i<a+1000; _i++ )
>	*_i = get_some_arbitrary_value();
>}
>
>These two pieces of code do the exact same thing, but if you are 
>worried about low-level efficiency the second version is a little
>tighter, as each reference to the array value in the pointer version
>requires less work to come up w/ that address.
>
>The second version would not be possible unless you had pointers that
>knew what type they were supposed to point to, and thus know how many
>bytes to increment the address to get to next guy.
>-- 
>
>Greg Henderson   henders@infonode.ingr.com   ...uunet!ingr!infonode!henders
>
>
That is not true. The 1st code should run faster (at least on the IBM/6000
workstation). When you call the array, the computer copies part of this
array into the registers so that the following assignments will not take as 
long as the 1st assignment. This cannot be done in the 2nd program where 
pointers are used (unless you have a very strong optimizer). 
For more information you can refer to "Hints on how optimize fortran and
C codes" by ibm.
-Samer
Newsgroups: comp.lang.c,comp.lang.c++,comp.binaries.ibm.pc.d
From: jsteele@netcom.com (John Steele)
Subject: Re: Contacting Al Stevens...
Date: Fri, 28 Aug 92 23:13:49 GMT
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 

In <kjb.715011409@godzilla.cgl.citri.edu.au> kjb@cgl.citri.edu.au (Kendall Bennett) writes:

>Does anyone know how to contact Al Stevens from DDJ over the internet?
>He wrote the DFLAT windowing system for MS DOS, and I would like to 
>talk to him...

He has a Compuserve account, id 71101,1262.  You can reach him by sending
email to 71101.1262@compuserve.com (notice the comma replaced with a period).

His id is posted at the bottom of his articles...

Hope this helps,
  John
-- 
#include <disclaimer.h>			/* route all flames to /dev/null  */
/**************************************************************************/
/*   Systems Analyst      | John Steele     email: jsteele@netcom.com     */
/* Video Business Systems |                                               */
/*   1-800-255-3088       |    Most people spell COBOLSUX incorrectly...  */
/**************************************************************************/
Newsgroups: comp.lang,comp.lang.c
From: davidkr@i88.isc.com (David Krunnfusz)
Subject: Help with RPGIII -> c conversion
Organization: INTERACTIVE Systems Corporation, Naperville, IL
Date: Wed, 02 Sep 1992 20:43:56 GMT

I'm looking for someone who has experience with both RPG (preferably
RPGIII, but if RPGII, I would still like to hear from you) and c
development. If you fit, please take your best guess stab at the following
question:

When re-writing an RPGIII application in c and SQL, would you expect the
total number of c and SQL statements in the re-write to be greater, about
equal or smaller than the total number of RPGIII lines in the original version
of the application? If not equal, what would you guess the ratio would 
be (3 lines of RPGIII = 1 lines of c/SQL; 5 lines of c/SQL = l line of
RPGIII)?

Please e-mail directly to me at davidkr@i88.isc.com. Your help is 
appreciated. 

Thanks,
Dave

PS Please give me some indication of your confidence in your numbers
(ie, you are an expert in both RPG and c, so you are quite confident;
you had only one class in RPG 15 years ago in school, so you are not too
confident; etc).

RPGIII to equal one line of c
reasonable to expect
From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
Newsgroups: comp.lang.c
Subject: Re: How can one make a dynamic array?
Date: 3 Sep 92 13:15:22 GMT
Organization: University of Helsinki

aphaswan@cs1.uct.ac.za (AK PHASWANA) writes:
>Most sorting procedures like bubble sort, bisection method, merge sort,
>use arrays. The problem with arrays is that they are not dynamic.

You can change the size of a dynamically allocated array in C.  Read
your friendly manual about malloc, calloc, realloc and free.

>Or is there any way of implementic sorting and searching procedures
>without using arrays?

You can sort lists pretty well with mergesort, or use automatically
sorted data structures such as some trees.

--
Lars.Wirzenius@helsinki.fi
Newsgroups: comp.lang.c,comp.msdos.programmer
From: jwiegand@moe.eng.temple.edu ()
Subject: Re: Graphics routines , source
Organization: Temple University EE Dept.
Distribution: north america
Date: Sat, 29 Aug 1992 05:21:52 GMT
X-Posted-From: moe.eng.temple.edu
X-Posted-Through: sol.ctr.columbia.edu

In article <BtI6FK.Es7@ecf.toronto.edu> dhaliwa@ecf.toronto.edu (DHALIWAL BIKRAM SINGH) writes:
>Does anybody know of any good graphics routines in source, and where
>I can FTP them?  (3-D graphics, windowing, animation etc.)    
> Bikram Dhaliwal (dhaliwa@civ.toronto.edu) 
> Oakville        (dhaliwa@ecf.toronto.edu) 

Try the IRIT stuff at SIMTEL or wuarchive.wustl.edu (mirrors/msdos/irit)
jim
From: scjones@thor.sdrc.com (Larry Jones)
Newsgroups: comp.lang.c
Subject: Re: MS-C fread bug
Date: 3 Sep 92 19:19:47 GMT

In article <1992Sep3.141100.28778@wuecl.wustl.edu>, drm4005@wuee1.wustl.edu (David Russell Maffitt) writes:
> Here is a simple piece of code that does not work under MS-C versions 6.0 or
> 7.0.  WHY?  Just save the file as main.c and compile with "cl main.c".

Because you're trying to read and write binary data but you've opened
the file in text mode instead of binary mode.  Change your fopens to
use "wb" instead of "w" and "rb" instead of "r" and it'll work much
better.

> What is magic about the value 70.689651???

I suspect you'll find that its binary representation contains a byte
with the value 0x1a (aka ^Z) which DOS interprets as end-of-file.
----
Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH  45150-2789  513-576-2070
Domain: lawrence.jones@sdrc.com               IBMMAIL: USSDR7DR at IBMMAIL
Mom would be a lot more fun if she was a little more gullible. -- Calvin