What\'s the point of negative ASCII values?
int a = \'«\'; //a = -85 but as in ASCII table \'<<\' should be 174
There is no such thing. ASCII is a table of characters, each character has an index, or a position, in the table. There are no "negative" indices.
Some compilers, though, consider char
to be a signed integral data type, which is probably the reason for the confusion here.
If you print it as unsigned int
, you will get the same bits interpreted as a unsigned (positive) value.