Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of Signed Char

Tags:

c++

c

what is the purpose of signed char if both char and signed char ranges from -127 - 127? what is the place where we use signed char instead of just char?

like image 737
Caffeinatedwolf Avatar asked Nov 28 '22 12:11

Caffeinatedwolf


1 Answers

  • unsigned char is unsigned.

  • signed char is signed.

  • char may be unsigned or signed depending on your platform.

Use signed char when you definitely want signedness.

Possibly related: What does it mean for a char to be signed?

like image 56
Lightness Races in Orbit Avatar answered Dec 16 '22 10:12

Lightness Races in Orbit