3 ms·
I don't know if the chart helps, but #define CTRL(x) ((x) ^ 0100) // e.g. 'C' ^ 0100 is 3 // e.g. '@' ^ 0100 is 0 // e.g. 'M' ^ 0100 is 13 a.k.
by jart 4y ago
I don't know if the chart helps, but
#define CTRL(x) ((x) ^ 0100)
// e.g. 'C' ^ 0100 is 3
// e.g. '@' ^ 0100 is 0
// e.g. 'M' ^ 0100 is 13 a.k.a. \r a.k.a. enter
I like this explanation better. It also explains what notation like ^C means. It's shorthand for 0100^C.
- jagged-chisel 4y agoExpanding your overloaded operator: Crtl-C is shorthand for 0100 xor ‘C’ Also, the 0 prefix means this is a base-8 (octal) number