Mail Archives: djgpp/1997/07/25/22:03:00
Christian Granström wrote:
> I tried to typecast them like:
>
> double X:
> unsigned char Y;
>
> Y = (unsigned char X);
This is a syntax error. You mean:
double d;
unsigned char uc;
uc = (unsigned char) d;
> This seems to work until i put Y into an vector. Compilator bug???
> It also works fine if I printf() Y before puting it into the vector!
If my vector you mean array (they're not called vectors in C), then it
just looks like this:
double da[];
unsigned char uc;
uc = (unsigned char) da[i];
> Maybe its not supposed to be done this way at all but the
> compiler does'nt complain about it!!
It shouldn't have worked at all.
--
Erik Max Francis, &tSftDotIotE / email / max AT alcyone DOT com
Alcyone Systems / web / http://www.alcyone.com/max/
San Jose, California, United States / icbm / 37 20 07 N 121 53 38 W
\
"Love is not love which alters / when it alternation finds."
/ William Shakespeare, _Sonnets_, 116
- Raw text -