Actually the code they put doesn’t work at all — or rather it does, but not as they intended.
In this case they were actually comparing an address to a number (assuming String => char* in the case of C), which is perfectly valid, but that condition is likely never going to evaluate as true.
But even in Java, character literals are just numbers, so the comparison should be fine if that error is corrected
23
u/OptimalMain Nov 13 '20
If(in >= 48 && in <= 57){ result = in - 48 }