HDTenEightyP/NetNews huggingface dataset:
From: rat@po.CWRU.Edu (Reza A. Tabib-Azar)
Newsgroups: comp.lang.c
Subject: Re: conversion from char to ascii value
Date: 10 Sep 1992 13:46:54 GMT
Organization: Case Western Reserve University, Cleveland, OH (USA)
Reply-To: rat@po.CWRU.Edu (Reza A. Tabib-Azar)
NNTP-Posting-Host: thor.ins.cwru.edu


In a previous article, els337w@mdw010.cc.monash.edu.au (Mr D. Singh) says:

>Can anybody please help me with my assignment!!!!!
>
>I have a small problem with the conversion of a char to ASCII
>I have looked  in books but to no avail
>

You mean the ASCII value, well I think you can use unsigned ints as a char
where ever you like. i.e in a printf statement you can simply replace %c with
a %d and therefore get the ASCII value printed.
I hope this will help.


>
>
>THank you for your help
> 
>
Newsgroups: comp.lang.c
From: eletanjm@nuscc.nus.sg (TAN JIN MENG)
Subject: Re: C vs. FORTRAN
Organization: National University of Singapore
Date: Sat, 5 Sep 1992 05:00:43 GMT

mcs@goblin.caltech.edu (Martin Shepherd) writes:
: 
: In the particular program cited, you can speed up the code considerably
: by using trigonometric recurrence to remove the sin() and cos() function
: calls from inside the loop.
: 
: Using the trig identities:
: 
:  cos(a+b) = cos(a)*cos(b) - sin(a)*sin(b)
:  sin(a+b) = sin(a)*cos(b) + cos(a)*sin(a)
: 

  [etc etc]

There is another way - if you're willing to do a little assembly -
almost trivial if your compiler supports inlining assemably code and you
are doing this on a x86/x87 machine. There is a machine instruction that
generates both the sine and cosine products from a single argument.

jin meng
Newsgroups: comp.lang.c
From: cflatter@nrao.edu (Chris Flatters)
Subject: Re: Optimizers and (NaN != NaN) (was Re: H
Reply-To: cflatter@nrao.edu
Organization: NRAO
Date: Tue, 15 Sep 1992 19:55:40 GMT

In article 12489@taumet.com, steve@taumet.com (Steve Clamage) writes:
>cflatter@nrao.edu (Chris Flatters) writes:
>
>>In article 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?
>
>>Your compiler/hardware combination does not comply with IEEE-754.  File
>>a bug report (or buy a better compiler).
>
>After a careful re-reading of 754, I'm not convinced it requires that
>(x!=x) hold for NaN's.  NaN's must not compare equal, but that is not
>the same as saying they must compare unequal!
>
>IEEE-754 talks about "equal", "unequal", and "unordered".  NaN's
>are "unordered", and it is unspecified (in 754 or the C Standard)
>whether the != operator in C includes "unordered".

IEEE-754 does not specify the bindings between floating-point predicates
and operators in C (or any other language).  It does however state that
the predicates with the ad hoc notations =, ?<>, >, >=, < and <= must
be available in a conforming implementation.  The possible interpretations
for ANSI C operators are as follows

	C operator	"natural" meaning	alternate meaning

	    ==		       =			 ?=
	    !=		       ?<>                       <>
            >                  >                         ?>
            >=                 >=                        ?>=
            <                  <                         ?<
            <=                 <=                        ?<=
            
The "natural" interpretations are the required IEEE-754 functions that
have the required properties if neither of their operands is
unordered.  The alternate operations differ only in their treatment of
unordered numbers.

While it is possible for a C compiler vendor to bind a C operator to
one of the predicates in the alternate column there must be a way to
access the predicate in the "natural" column.

Specifically, if your C compiler evaluates x != y as false when one or
both of x and y are NaN's it must have an alternate operator or a
library function for not-equal (and x != y must signal an invalid
operation when x or y is a NaN) if it is to comply with IEEE-754.  Even
if the alternative operator or library function is provided this is a
gratuitously wierd way in which to implement IEEE arithmetic and is
(IMHO) grounds for complaint if you ever find a compiler that does
this.

		Chris Flatters
		cflatter@nrao.edu
Newsgroups: comp.lang.c
From: pgrg9345@uxa.cso.uiuc.edu (pAul rAdja )
Subject: Memory
Organization: University of Illinois at Urbana
Date: Sat, 12 Sep 1992 21:01:54 GMT
Keywords: Borland C


  I have a rather simple question, I hope. I have the borland c++ compiler
  ( version 3.0) along with a gateway2000, which has 8meg. I need to 
  create a rather large data space +600K and I am unable to do it.
  The old dos 640k problem I suppose... If this is a faq I am sorry but
  I am just getting rather upset at this problem.....
  Any help would be appreciated...

   Thank you in advance,

     _paul
-- 
-----------------------------------------------------------------------
|  Log....  Log....  Log.... It is better than bad its Good.... Log!  |
|    pAul rAdjA   pradja@adsl.ece.uiuc.edu                            |
-----------------------------------------------------------------------
Newsgroups: comp.lang.c,comp.std.c
From: mjn@pseudo.uucp (Murray Nesbitt)
Subject: Re: strcpy implementation question
Organization: Private system in Toronto, ON
Date: Mon, 7 Sep 1992 10:28:36 GMT
	<1992Aug26.224904.7671@sneaky.lonestar.org>
	<PINKAS.92Sep2173635@skywalker.intel.com>
	<1992Sep03.205646.11564@ima.isc.com>


karl@ima.isc.com (Karl Heuer) writes:

>	#include <stdio.h>
>	char dst[4] = "abc";
>	char src[4] = "";
>	int main(void) {
>	    strcpy(dst, src);
>	    if (dst[1] != 'b') printf("strcpy() is broken\n");
>	    return 0;
>	}
>
>The undocumented side effect caused by the proposed "optimization" would have
>an effect on the execution of this strictly conforming program.

Wouldn't this program need to #include <string.h> (or at least have a
declaration for strcpy()) for strict conformance?

-- 
Murray
Newsgroups: comp.lang.c
From: darcy@druid.uucp (D'Arcy J.M. Cain)
Subject: Re: getting characters
Date: Tue, 15 Sep 1992 12:25:02 GMT
Organization: D'Arcy Cain Consulting

karl@ima.isc.com (Karl Heuer) writes:
>optionally turn off ECHO).  On some Unix variants you may have to turn on the
>CBREAK flag instead.  If you have the curses package and don't mind using it
>for this project, you can use its getch() function, which does this for you.

But you still have to set CBREAK first.  Curses supplies cbreak() for this
purpose.

-- 
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   |
From: bob.calbridge@u2u.lonestar.org (Bob Calbridge)
Newsgroups: comp.lang.c
Subject: Help! what's wrong with this program?
Date: 8 Sep 92 23:07:00 GMT
Reply-To: bob.calbridge@u2u.lonestar.org (Bob Calbridge)
Organization: USER-TO-USER PCBoard (214)492-6565 (USR DS v32bis)

To: zzang@whale.uucp (Zhuo Zang[~{j0WA~}])
Date: Sun, 6 Sep 92 04:14:10 GMT

ZZ> Hello,
ZZ> I try to push char c onto buf, and then
ZZ> print out the buf.
ZZ> But the following codes don't work.
ZZ> After compilation, I use
ZZ> > foo <foo.c
ZZ> nothing printed out.

ZZ> Could someone tell me why ?

ZZ> Thanks in advance !
ZZ> --------- foo.c ----------
ZZ> #include <stdio.h>
ZZ> char *sp, buf[BUFSIZ], c;
ZZ> main()
ZZ> {
ZZ>   sp = buf;
ZZ>   while ((c=getchar())!=EOF) pushc(c,sp);
ZZ>   *sp = '\0';

ZZ>   puts(buf);
ZZ>   return;
ZZ> }

ZZ> pushc(char c, char *bp)
ZZ> {
ZZ>   *bp++ = c;
ZZ>   return;
ZZ> }

Confusion between what you're passing and what is really being affected.
The char *bp in your function is a local variable and regardless of what
happens to it when the function is executed does nothing to affect the
value of the variable that was passed to it.  In essence, when you
"bp++" the value of "sp" in main() doesn't change so you keep passing
the value of buf on each iteration.  As a consequence bp keeps
{ obtaining the value of buf and gets incremented} over and over again.
sp never changes.  You need to either

   1) declare a global variable as your pointer and use it in main
      and the function.
   2) skip using pushc() and simply use a pointer in main and
      manipulate it within main().
   3) do something more complex by making bp a static variable and
      modifying the function to accept an action flag to set the
      pointer to a passed value.

 * SLMR 2.1 * hAS ANYONE SEEN MY cAPSLOCK KEY?
                                                                                                                                
Xref: sparky comp.lang.c:13665 comp.lang.c++:13655 comp.os.msdos.apps:4751 comp.os.msdos.programmer:9359
From: dve@mace.cc.purdue.edu
Newsgroups: comp.lang.c,comp.lang.c++,comp.os.msdos.apps,comp.os.msdos.programmer
Subject: Re: Should I buy BC++ 3.1??
Date: 15 Sep 92 02:59:00 GMT
Organization: Purdue University

>>>in this business.  As soon as Windows NT and OS/2 are established, only
>>>a few die-hards will still be running DOS.  Let the people with old
>>>8088's have it.
>
>hey... i thought Oberon is supposed to be the future business...
>(that is, say good-bye to windows and os/2!!!)
>
>does anyone agree with me?
	
	Isn't Oberon a language instead of operating system?

	As to the original question: "Should you buy BC++ ?". I think if
	you neither are very rich nor are about to develop programs to sell
	for profit, buying BC++ is not very worthwhile. After all Windows is
	not the future (Byte and PC magazine people seem to agree on this 
	point). OS2.0 might preveal, at least some of its ideas should.

	The way I see it, the futher PC will probably have the capacity of what
	we call mainframe today. A lot of people can already afford SUN stations
	for personal use. I can not imagine myself satisfied with something
	as shaky as MS Windows running on such a machine. MS Windows is
	only an experiment or a commercial scam. The theories of computer
	science (protection, recovery, multi-process or threads, etc.) behind
	MS Windows are those of the 60s, not much younger than that behind
	the DOS.

	BC++ has a lot of its stuff targeted at Windows, so it's not going
	to last. I myself can wait for the compiler for OS2.0, which I'm sure
	is to appear very soon.

	Isn't Borland also working on exception handling? I believe there's
	no technical difficulty in implementing it (having written a compiler
	with exc hdl myself.) The theory is already there. Nothing very new.

	So I expect Borland to yet release a new version very soon. So it
	may be a bad idea to buy BC++ now. BC++2.0 enjoyed a bigger hoopla
	than BC++3.1, yet those stuck with BC++2.0, including myself, look
	very silly today only a few month later.

	Zhou
Xref: sparky comp.lang.c:13252 comp.unix.questions:10758
From: ramesh@cirrus.com (Ramesh Balasubramanian)
Newsgroups: comp.lang.c,comp.unix.questions
Subject: How to store data files in binary format
Date: 5 Sep 92 03:10:51 GMT
Organization: Cirrus Logic Inc.  Fremont, California


We have data files (ascii now) which are huge. I'd like to know how
one goes about storing these in binary (or some other compressed)
format and have programs read these files to build the necessary
data structures?

Thanks in advance,

 -Ramesh (ramesh@cirrus.com)
Newsgroups: comp.lang.c
From: eletanjm@nuscc.nus.sg (TAN JIN MENG)
Subject: Re: Only C gurus allowed?!?!
Organization: National University of Singapore
Date: Thu, 10 Sep 1992 01:51:22 GMT

behrenss@Informatik.TU-Muenchen.DE (Soenke Behrens) writes:
: eletanjm@nuscc.nus.sg (TAN JIN MENG) writes:
: 
: >I got flaming mail to the effect that I was wrong, that my explanation
: >was garbage etc etc and that I shouldn't post in this group (to help
: >others) unless I'm very sure of the facts.
: 
: What I think of this: People acting like unsecure teens that need to show that
: they _are_ worth something, and therefore take any opportunity to show you how
: cool they are. Or, in other words: If you get a flame mail, route it it 
: to /dev/null and forget about it.
Actually in retrospect - maybe I didn't overreact slightly ;-). I had a
long and trying day.

jin meng
Xref: sparky comp.lang.c:13523 comp.sys.sun.misc:4181
From: clive@x.co.uk (Clive Feather)
Newsgroups: comp.lang.c,comp.sys.sun.misc
Subject: Re: sun cc optimization failure
Date: 11 Sep 92 13:03:16 GMT
Organization: IXI Limited, Cambridge, UK

In article <26053@dog.ee.lbl.gov> torek@horse.ee.lbl.gov (Chris Torek) writes:
>In article <1992Sep3.040401.16902@mr.med.ge.com> carl@aslmr-serv.med.ge.com
>(Carl Crawford) writes:
>> main() {
>>	int i,j,ax;
>>	ax = 0;
>>	for(i=0;i<3;i++){
>>		j = ax * i;
>>		puts("in for loop");
>>	}
>> }
> This program fails strict conformance by:
>	A: not including <stdio.h>;

Not required. The type of puts (int puts (const char *)) means that the
implicit declaration is sufficient [Standard sections 7.1.7 and 7.9.7.10].

>	B: reaching the end of an int-valued function (main()) wihtout
>	   returning a value.

Not required per se. An int-valued function is permitted to not return
a value, provided that value is not used [Standard section 6.6.6.4].

The only problem with the function is that is violates section 5.1.2.2.3
of the standard:
| If the *main* function executes a return that specifies no value, the
| termination status returned to the host environment is undefined.
Thus the program might cause problems with the host environment, but its
actual behaviour is well-defined.
-- 
Clive D.W. Feather     | IXI Limited         | If you lie to the compiler,
clive@x.co.uk          | 62-74 Burleigh St.  | it will get its revenge.
Phone: +44 223 462 131 | Cambridge   CB1 1OJ |   - Henry Spencer
Fax:   +44 223 462 132 | United Kingdom      |
From: anonymous@hmivax.humgen.upenn.edu
Newsgroups: comp.lang.c
Subject: Question for the readership . . .
Summary: Parsing a string for spaces
Date: 9 Sep 92 14:16:22 GMT
Reply-To: perkel_j@a1.mscf.upenn.edu
Organization: HHMI/Human Genetics, Univ of Pa.

Hello, everybody!  I've got 2 questions for the programming public.
Please help!

1.  (This one's probably been addressed before . . .)  How can I parse a
command line or string to remove spaces at the end of the string (or, how can
I test a string to find spaces).  Also, how can I test for the presence of any
character at a specific point.

2.  Given a text file containing a series of structures containing names
and addresses, if each one is numbered, how can I move the pointer to a 
desired 'record' to modify it (i.e., the user wishes to modify address number
26)?

Thank you in advance!

jeff perkel
perkel_j@a1.mscf.upenn.edu
From: raymond@es.ele.tue.nl (Raymond Nijssen)
Newsgroups: comp.lang.c
Subject: How can cpp be used to generate a unique identifier name?
Date: 15 Sep 92 12:07:13 GMT
Distribution: comp
Organization: Eindhoven University of Technology, Eindhoven, The Netherlands

I want to use the preprocessor to generate a new, unique name for a variable;
something like `_<linenumber>' would do the job.

However, `int _ ## __LINE__' doesn't work, because ## is dealt with first,
generating `___LINE__', in which cpp doesn't expand the __LINE__ token.

So my question os: how can I manupulate the order of expansion of these
preprocessor tokens ?

Any alternative ideas?

aTdhvaannkcse,
-Raymond
--
| Raymond Nijssen         | Eindhoven University of Techology                 |
|                         | Department of Electrical Engineering              |
| raymond@es.ele.tue.nl   | Design Automation Section (ES),  Room EH 7.16     |
| phone: +31-40-473373    | P.O. Box 513, 5600 MB Eindhoven, The Netherlands  |
| fax:   +31-40-464527    |  "Jan Timmer for President of The Netherlands!"   |
From: quanstro@lars.StOlaf.edu (goon)
Subject: Re: Giles' Manual Mania (Was - Re: About the 'F' in RTFM)
Organization: St. Olaf College, Northfield, MN USA
	<QUANSTRO.92Sep2095812@lars.StOlaf.edu>
	<1992Sep3.162038.28706@newshost.lanl.gov> <7228@charon.cwi.nl>
	<1992Sep4.175637.7676@newshost.lanl.gov>
Date: 5 Sep 92 22:39:05

In article <1992Sep4.175637.7676@newshost.lanl.gov> jlg@cochiti.lanl.gov (Jim Giles) writes:

   In article <7228@charon.cwi.nl>, dik@cwi.nl (Dik T. Winter) writes:
   |> In article <1992Sep3.162038.28706@newshost.lanl.gov> jlg@cochiti.lanl.gov (Jim Giles) writes:
   |>  > [...]
   |>  > CDC's Scope was *much* easier to use.  Being a `vintage' system, it had
   |>  > about the same capabilities as UNIX.
   |> Eh?  What about the approximately flat file system, the inconsistency
   |> between programs with respect to their argument handling?  [...]

   [... Long list of inconsistencies elided ...]

   See?  About the same level of capabilities.  Just as I said.
   Inconsistencies are rampant in *both* systems.  Scope was easier
   to learn and use.  Both are now *obsolete*.  Only one is still 
   being promoted.

Wow! Where does he get all this detailed and precise information.
From: murakami@idas.imslab.co.jp (Mr.Murakami)
Newsgroups: comp.lang.c
Subject: XCMD or XFCN(HyperCard/Think C5.0.2) (In Nipponese)
Keywords: XCMD
Date: 10 Sep 92 09:43:50 GMT
Organization: Information and Mathematical Science Lab. Inc., Tokyo, Japan


  Hello.
  My name is Murakami, Yukio.
  This Question.
  Do I set Attr to 20 at making XCMD?
  Do I set Attr to 0 at making XCMD?
  How to make XCMD?
  Thank You!

-- 
$B4d@P@83h<T(J		Yukio Murakami@idas.imslab.co.jp
Newsgroups: comp.lang.c
From: kjb@cgl.citri.edu.au (Kendall Bennett)
Subject: Re: Sets in C
Organization: RMIT Advanced Computer Graphics Centre, CITRI, Melbourne
Date: 11 Sep 92 04:24:35 GMT

s913578@yallara.cs.rmit.OZ.AU (Fantom) writes:

>I've been looking at implementing sets in C,
>the method needs to be able to handle sets of more than 32 elements
>so using bit fields won't work

Why not? Who says that a bitfield has to be 32 bits - make it as big as
you want.

>Any other ideas (my method is extremely bulky)

Check out the code in my 'ctools10.tar.Z' archive. It has a set of routines
(no pun intended :-) for doing set manipulation. You can get it from:

	godzilla.cgl.rmit.oz.au (131.170.14.2)

as the file

	~ftp/kjb/ctools10.tar.Z

+------------------------------------------+-------------------------------+
| Kendall Bennett                          | Internet:                     |
| RMIT Advanced Computer Graphics Centre   | kjb@citri.edu.au              |
| CITRI Building, 723 Swanston Street      | rcskb@minyos.xx.rmit.oz.au    |
| Carlton Victoria 3053 AUSTRALIA.         |                               | 
+------------------------------------------+-------------------------------+
| CoSysop (Bossman), PC Connection Australia:               +61 3 688 0909 |
+--------------------------------------------------------------------------+
Newsgroups: comp.lang.c
From: u8800914@cs.uow.edu.au (Mohammad Salim Olime)
Subject: FLOATING POINT ARITHMATIC INSIDE a TSR
Summary: doing floating point operation inside a TSR
Keywords: FLOATING POINT TSR
Organization: Dept of Computer Science, Wollongong University, Australia
Date: Wed, 9 Sep 1992 06:51:00 GMT


I got problem doing floating point arithmatics inside a TSR.
According to AL STEVENS in "Extending Turbo C Proffessional"
[1989 pg 225] A TSR should avoid floating piont arithmatic because
" The Turbo C floating point package uses several interrupt vectors
which are attached in TURBO C's starting code. The vectors are
not restored until after a C program exits and returns to the start up
code. If successive TSRs were loaded this way, the last one would be doing
the floating operation for all of them."
The reason AL STEVENS given and I quoteed above did not make much
sense to me. In my case the TSR crushes with abnormal 
exit message.
Is there any way around this ?

Newsgroups: comp.lang.c
From: swalter@nyx.cs.du.edu (DreamWeaver)
Subject: Re: Help! what's wrong with this program?
Organization: University of Denver, Dept. of Math & Comp. Sci.
Distribution: usa
Date: Mon, 7 Sep 92 02:18:06 GMT


You're (all) right ... I'm wrong ...

Must've been thinking of something else ... what, I have no idea ...

Oh ... well ...

-Scotty
From: volpe@bart.NoSubdomain.NoDomain (Christopher R Volpe)
Newsgroups: comp.lang.c
Subject: Re: Name this sort routine.
Date: 10 Sep 92 14:24:46 GMT
Reply-To: volpe@ausable.crd.ge.com
Organization: GE Corporate Research & Development

In article <1992Sep09.113419.1131@ozrout.uucp>, stirling@ozrout.uucp (Stirling Westrup) writes:

|> #define INT_MIN (MAXINT+1)      /* I wonder how portable this line is ... */

How portable is it? How shallow is the ocean? How cold is the sun? :)

(Stolen from Douglas Adams)
-- 
==================
Chris Volpe
G.E. Corporate R&D
volpecr@crd.ge.com
Xref: sparky comp.lang.c:13706 sci.math:11516 comp.lang.misc:3091 comp.lang.fortran:3577 comp.std.c:2633
Newsgroups: comp.lang.c,sci.math,comp.lang.misc,comp.lang.fortran,comp.std.c
Subject: Re: Scientists as Programmers (was Re: Small Language Wanted)
From: a_rubin@dsg4.dse.beckman.com (Arthur Rubin)
Date: 15 Sep 92 21:45:40 GMT
Followup-To: comp.std.c
 <1992Sep4.162938.29237@dscomsf.desy.de> <Bu2r42.5xr@mentor.cc.purdue.edu>   
 <id.I12T.GP4@ferranti.com> <a_rubin.716152347@dn66>   
 <1992Sep11.012559.17662@nntpd.lkg.dec.com> <a_rubin.716225408@dn66 
 <1992Sep12.164915.10734@jarvis.csri.toronto.edu> <1992Sep15.043224.27920@nntpd.lkg.dec.com>

In <1992Sep15.043224.27920@nntpd.lkg.dec.com> diamond@jit345.bad.jit.dec.com (Norman Diamond) writes:

>In article <1992Sep12.164915.10734@jarvis.csri.toronto.edu> flaps@dgp.toronto.edu (Alan J Rosenthal) writes:
>>a_rubin@dsg4.dse.beckman.com (Arthur Rubin) writes:
>>>>>>	int a, b;   long c;
>>>My interpretation (from reading K&R 2) would be that c = a * b should be
>>>equivalent to c = (int)(a * b).

>Mr. Rubin, please state which section of the standard requires this.
>If you cannot, then please at least quote the text in K&R 2 that led you to
>this interpretation, so that we can see if K&R 2 has a bug that would be
>worth recommending for correction and/or warning about.

My copy of K&R 2 has walked away.  K&R 1, in the section on type
conversions (2.7), states:

    Implicit arithmetic conversions work much as expected.  In general, if
    an operator like + or * which takes two operands (a "binary operator")
    has operands of different types, the "lower" type is _promoted_ to the
    "higher" type before the operations proceeds.  The result is of the
    higher type....

I don't recall exactly what the analogous section of K&R 2 states, but I
recall that last sentence being there.  This implies that the result in
case of overflow, although undefined, is an undefined int.

Followups to comp.std.c, as it no longer is relevant to any of the other
groups.
--
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.
My interaction with our news system is unstable; please mail anything important.
Newsgroups: comp.lang.c