Quick question on what this statement does

closed account (jEb91hU5)
I found this code from another source, and I was just wondering if I can get a quick explanation on what it does exactly.

"skip" is an int data type. This statement is also in a while loop.

 
  skip = skip == 2 ? 0 : skip + 1;


Thanks for the help.
It increments skip mod 3, so it's equivalent to the much better skip = (skip + 1) % 3;
closed account (jEb91hU5)
Oh. That makes more sense. Thank You!
Topic archived. No new replies allowed.