26 Nov
2018
26 Nov
'18
10:15 p.m.
On 27/11/2018 09:40, Emil Dotchevski wrote:
This is not what unsigned is for. You should generally use signed ints even if the value can't be negative.
Why? Other than being less typing (which is, I think, the real mistake), what reason is there for this?
Fact: the cast does not do the same thing as the implicit conversion.
(The cast converts to the type you specify in the cast. The implicit conversion converts to the target type.)
No, the implicit conversion promotes to *some* type (usually one of int, unsigned, int64_t, or uint64_t), which is not necessarily the type of either.