4
I’ve never seen this operator before, just another like ->
, but it makes no sense in the context of that code.
Code
#include <stdio.h>
int main() {
int x = 10;
while (x --> 0) { // x goes to 0
printf("%d ", x);
}
}
Exit
9 8 7 6 5 4 3 2 1 0
I saw the "// x Goes to 0" and decided to share something else. All the Eng. Computer Science teachers I’ve had suggested the golden rule: ALWAYS avoid using go-to commands on high-level Lps (not to say never use). I do not know if the excerpt of this post was found on the web. It’s good to remember this rule because, although certain high-level Lps contain go-to, this command can generate issues, and at least hinder the readability of the source. As a beginner programmer, trust me, there will come times when apparently a go-to would solve everything, but resist and do otherwise.
– Breno Zanchetta