float x = 110.1f;
unsigned char c = ''0'';
c = unsigned char(x);
or
float x = 110.1f;
unsigned char c = ''0'';
c = unsigned int(x);
I get errors on this? Why? Shouldn''t I be able to type cast any primitive type?
float x = 110.1f;
unsigned char c = ''0'';
c = unsigned char(x);
or
float x = 110.1f;
unsigned char c = ''0'';
c = unsigned int(x);
I get errors on this? Why? Shouldn''t I be able to type cast any primitive type?
quote:Original post by Anonymous Poster
You need to type..
c = (unsigned int)(x);
unsigned char
type. It sees the char
, casts it, and then sees some suspicious looking unsigned
type that blows its mind.