3 ms·
I've also personally encountered 24 for C. That's not the problem with (' '*13) here, though — C doesn't mandate ASCII.
by kps 10y ago
I've also personally encountered 24 for C. That's not the problem with (' '*13) here, though — C doesn't mandate ASCII.
- ekiru 10y agochar is also allowed to be a signed type, in which case overflow is undefined behavior.
- evincarofautumn 10y agoIt’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.