Would you like signs with those chars?
Would you like signs with those chars?
Posted Oct 24, 2022 19:41 UTC (Mon) by mss (subscriber, #138799)Parent article: Would you like signs with those chars?
That signed / unsigned char difference is a potent source of subtle bugs.
For example the following code:
char c = 0xff;
printf ("%x\n", c - 1);
will print fffffffe if char is signed but just (intuitively expected) fe if it is unsigned.
