quote:Original post by smitty1276
That last bit ("an integer can''t hold a character") isn''t exactly true.
It''s perfectly legal to say:
int x = ''a'';printf("%c", x);
Is it not?
yeah, integers can hold chars. you can do integer math on chars as well. basically, just think of a char as an 8bit int, and all the ''x'' characters are just aliases for ASCII values. I really can''t think of anyway that they are different. Just remember, a char might not be able to hold any ol'' integer, because of the precision difference.
If I remember correctly, even in relatively type "safe" languages like Java, you can assign chars to ints without casting (but definitely would have to cast if you are going from int to char).
capn_midnight | Captain Midnight | deviantArt
ACM | SIGGRAPH | Generation5
"I''m tired of all this nonsense about beauty being only skin-deep. That''s deep enough. What do you want - an adorable pancreas?" -Jean Kerr