I've also personally encountered 24 for C. That's not the problem with (' '*13) here, though — C doesn't mandate ASCII.
char is also allowed to be a signed type, in which case overflow is undefined behavior.
Re:So you think you know C?
by evincarofautumn on Tuesday November 08, 2016 @10:50PM
(#12905914)
It’s not because of the signedness of char—not only do character literals have type int, but even if this weren’t a literal, the char would be promoted to (signed) int before the multiplication. But of course the multiplication of two ints can still overflow.
> Most people assume that a byte is 8-bits which isn't true.
It is worth remembering that POSIX (and Windows probably too) mandate 8bit chars so there is no point being defensive about it on these particular platforms. And I kid you not, I have seen people who are. Because "ISO C99 this and that".
From ISO/IEC 9899:2011:
Edit: Reading further into the C11 spec, `5.2.4.2.1 Sizes of integer types <limits.h>`, it says that `CHAR_BIT` must be 8 bits (or larger). A google search suggests there exists some processors that have 16-bit bytes and others that have 32-bit bytes.