r/C_Programming • • Jun 15 '26

Question Question regarding unsigned integers

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

12 Upvotes

93 comments sorted by

View all comments

Show parent comment

2

u/sreekotay Jun 16 '26

actually you;re right and I was wrong. it's only compare and bitshift right I think?

1

u/markuspeloquin Jun 16 '26

Well actually we are both wrong because negation makes no sense for signed vs unsigned. I was thinking about how negation works the same for positive vs negative numbers

Edit yes, comparison and right-shift have different instructions for signed vs unsigned.