+ 6

What is the difference between int and signed,unsigned,long signed?

23rd Apr 2017, 11:32 AM
Badr
Badr - avatar
4 Respostas
+ 4
The difference between int and long are the number of bytes. While a long holds higher numbers than an int does. int and signed are the same. Signed and unsigned are different in that unsigned cant be negative which holds a higher range of positive numbers. You are capable of saying unsigned long with out int on the end. As unsigned long is implied as an integer. Here is a site to help understand the differences maybe in more detail. http://www.cplusplus.com/doc/tutorial/variables/
23rd Apr 2017, 4:39 PM
Ty Ler
Ty Ler - avatar
+ 7
Note: the size of int does not change when using un/signed just the range of numbers it stores.
23rd Apr 2017, 11:57 AM
jay
jay - avatar
+ 7
Thank you all
24th Apr 2017, 2:43 PM
Badr
Badr - avatar
+ 3
unsigned int can't be negative (0..65535), and signed int can (-32768..+32768)
23rd Apr 2017, 11:48 AM
Иван Чубинец
Иван Чубинец - avatar