3 ms·
I have actually programmed for an architecture where sizeof(int) is 1. Yes, a very unusual one.
by TorKlingberg 15y ago
I have actually programmed for an architecture where sizeof(int) is 1. Yes, a very unusual one.
- aidenn0 15y agoYou mean many 8-bit micros and also any word-addressable architectures? I don't think it's that unusual.
- angusgr 15y agoWhich 8-bit micros? avr-gcc, PIC microchip C, HC11 gcc, SDCC (for HC11, 8051, Z80, etc.) all have 16-bit ints. Also, the C standard "Sizes of Integer Types" section sets out minimum ranges each type must allow, and I think int has always been +/-32767. ie see the section at http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf