[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Type Casting
From: |
Doug Donalson; |
Subject: |
Type Casting |
Date: |
Thu, 28 May 1998 17:36:03 -0700 (PDT) |
This is really a programming question.
I want to cast a double (or int) to a char. Now
as long as it is only a single digit I thought there should
not be a problem. (My OLD books say the same.) Actually,
the conversion is supposed to take the lowest digit regardless
of the numerical format.
So:
int x;
char y;
x=1;
y=(char)x;
putchar(y);
The output of this is "got 1".
What the heck does this mean??? I admit that
it's a long time since I did this type of
char manipulation, but I know I never got this before.
While I'm at it, I tried the "string" in Swarm and ran
into a problem. Defined as a String * the compilier
flags an error. I figured that this was another case
where the protocall was already implimented, so I changed
it. This got rid of the compiler error, but then String
does not recognize "appendC:" .
What am I doing wrong.
Cheers,
D3
***************************************************************************
* Doug Donalson * Office: (805) 893-2962 *
* Ecology, Evolution, and Marine Biology * Home: (805) 961-4447 *
* UC Santa Barbara * email address@hidden
* Santa Barbara Ca. 93106 * *
***************************************************************************
* *
* The most exciting phrase to hear in science, the one that *
* heralds new discoveries, is not "EUREKA" (I have found it) but *
* "That's funny ...?" *
* *
* Isaac Asimov *
* *
***************************************************************************
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
==================================
- Type Casting,
Doug Donalson; <=
- Re: Type Casting, Marcus G. Daniels, 1998/05/28
- Re: Type Casting, Doug Donalson, 1998/05/28
- Re: Type Casting, Marcus G. Daniels, 1998/05/28
- Re: Type Casting, Doug Donalson, 1998/05/29
- Re: Type Casting, Marcus G. Daniels, 1998/05/29
- Re: Type Casting, Marcus G. Daniels, 1998/05/29
- Re: Type Casting, glen e. p. ropella, 1998/05/29
- Re-scaling in EZGraph, Parviez Hosseini, 1998/05/29
- Re: Re-scaling in EZGraph, glen e. p. ropella, 1998/05/31