r/C_Programming • • Jun 15 '26

Question Question regarding unsigned integers

What's the difference between an unsigned int and a normal integer?

11 Upvotes

93 comments sorted by

View all comments

Show parent comment

2

u/gahw61 Jun 16 '26

The compiler can assume overflow does not happen, which allows it to apply optimizations that would be invalid if signed overflow was defined in the language spec.