C signed Keyword
Example
Store a negative number in a signed char:
signed char myNum = -100;
printf("%d", myNum);
Definition and Usage
The signed keyword specifies that an int or char can store both positive and negative values.
For int, this is the default, so signed int means the same as int. For char, it depends on the system if a plain char can store negative values. Use signed char when you need a small number that can be negative.
A signed char uses 1 byte, and can store numbers from -128 to 127 on most systems.
Related Pages
The unsigned keyword specifies that an int or char can only store zero and positive values.
Read more about data types in our C More Data Types Tutorial.