[A89] Re: Char vs. Int


[Prev][Next][Index][Thread]

[A89] Re: Char vs. Int




Hi!

> It's just you.  An int takes 2 bytes of memory, but a char takes only 1.
> Of course, if you have a long string of characters, then it will be
longer
> than a single int.  Also, if you use a structure like
> 
> struct abc {
>    char x;
>    int y;
> };

Note, however, that working with char vars produces something more bloated
code than working with ints, because the compiler can better optimize
calculations with ints than with chars.

Zeljko Juric