4 ms·
sizeof(char) is implementation defined; see limits.h for more information on the probable size of char for your target. If the sizeof(char) is 1, the division w
by BudVVeezer 13y ago
sizeof(char) is implementation defined; see limits.h for more information on the probable size of char for your target. If the sizeof(char) is 1, the division will be optimized away, so there's no loss by keeping the code portable.
- Sharlin 13y agoNo, the size of char (in bits) is implementation defined, but sizeof(char) is defined to be 1, no matter what its size in bits.
- deleted 13y ago[deleted]
- chollida1 13y agoNo this is incorrect, see: http://stackoverflow.com/q/4562249/25981 http://stackoverflow.com/q/4562249/25981 sizeof(char) is always defined to be one. This can't be altered by a conforming compiler.
- EpicEng 13y agoWrong. sizeof(char) is define to be one. The number of bits in a byte (char) is implementation defined (this is why CHAR_BIT exists). Not the same thing.