Why does the compiler understand ASCII by default?
https://piefed.blahaj.zone/c/c_lang/p/804353/why-does-the-compiler-understand-ascii-by-default
Why does the compiler understand ASCII by default?
https://piefed.blahaj.zone/c/c_lang/p/804353/why-does-the-compiler-understand-ascii-by-default
@akunohana Apologies if I'm missing something, but 0x30, 0x39, and 0x18 are merely hex notation for integers. You could have written 48, 57, and 24 instead for the same effect. Or you (probably?) could have used char literals like '0', '9' (I guess there isn't one for U+0018).
UTF-8 determines how the characters are encoded, i.e. what sequence of numbers (ints) they are represented by. So there's no special understanding of Unicode or hex going on here; you're comparing numbers (as you should).
LOL (please excuse my early 2000’s slang)
Thanks for that clarification.
What I still don’t quite understand is, does this mean that there is no “checking against an ASCII table” or “lookup” going on? But how then does it know that 0x18 is CAN (disregard)?