How to avoiding nullchar converted to 0? [closed]
The problem here is the condition in the for-loop. That condition is fully evaluated after every iteration. That means not just the r< part, but also the strlen(number) part. This is generally a bad idea – strlen must check the whole sting to find the first \0. In very exceptional situations that might make sense, … Read more