r/C_Programming • u/Low_Minimum9920 • Jun 15 '26
Question Question regarding unsigned integers
What's the difference between an unsigned int and a normal integer?
11
Upvotes
r/C_Programming • u/Low_Minimum9920 • Jun 15 '26
What's the difference between an unsigned int and a normal integer?
View all comments
Show parent comment
1
u/pfp-disciple Jun 15 '26 edited Jun 15 '26
Minor correction: it nearly doubles the highest number it can represent. It's still (often) the same count of numbers. Signed
charis (often) -128 to 127, or 256 numbers. Unsigned char is (often) 0-255, or 256 numbers."Doubles the amount of numbers" could correctly be "doubles the amount of positive numbers".
Edit: lack of coffee, I goofed on CHAR_MIN; it's corrected now