3 ms·
++ is useful to switch over the items of a string: switch (x++) { case ‘+’: if (x == ‘+’) { op = OP_INC; x++;
by UncleEntity 4y ago
++ is useful to switch over the items of a string:
switch (x++) {
case ‘+’:
if (x == ‘+’) {
op = OP_INC;
x++;
} else if (x == ‘=‘) {
op = OP_ADDEQ;
x++;
} else {
op = OP_ADD;
}
break;
…
}