Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to convert unsigned characters into signed characters
How to convert unsigned characters into signed characters
That's right. c = t-40; Do it.

As long as the numerical range is not out of bounds, Uchar to char can be assigned directly. They are all 1 byte integers, one unsigned and the other signed.

For example:

Unsigned char t 1=0, t2 = 40.

char c 1,C2;

c 1 = t 1-40;

C2 = T2-40;

printf("%d %d\n ",c 1,C2);