What is the name of the "-->" operator?

🎙️ randybanks_ · 79 points · Posted at 19:47:27 on June 21, 2016 · (Permalink)


chugga_fan · 22 points · Posted at 19:56:57 on June 21, 2016 · (Permalink)

ahhh, the goes to operator, i perfer the "slides to" operator

while(x \
         \
          \
           ->y)
[deleted] · 9 points · Posted at 03:30:28 on June 22, 2016 · (Permalink)

Wait, shouldn't there be two hyphens?

Hullu2000 · 1 points · Posted at 06:50:33 on June 22, 2016 · (Permalink)

What does it do?

MrTwisT007 · 6 points · Posted at 11:42:23 on June 22, 2016 · (Permalink)

It slides the pointer to X down along the memory address rows until it's on the same row as the pointer to Y.

Deathbyceiling · 1 points · Posted at 16:28:59 on June 26, 2016 · (Permalink)
s3sebastian · 5 points · Posted at 00:54:17 on June 22, 2016 · (Permalink)

That spacing though

x --> 0
zelnoth · 2 points · Posted at 12:15:40 on June 22, 2016 · (Permalink)

Ah the good 'ol "goes to" operator.

YJCH0I · 1 points · Posted at 19:00:22 on June 22, 2016 · (Permalink)

Still waiting for the punchline…

xRahul · 3 points · Posted at 01:06:46 on June 23, 2016 · (Permalink)

Hey, did you get your punch yet? Or are you still waiting in line?

Miles-za · 1 points · Posted at 00:48:19 on June 24, 2016 · (Permalink)

So while(x --> 0); is another way to write x = 0 (assuming unsigned integers).

JudeOutlaw · 1 points · Posted at 23:07:29 on June 28, 2016 · (Permalink)

No. It's equivalent to while ((x--) > 0)

Or while (x > 0) { x = x - 1; ... }

Miles-za · 1 points · Posted at 12:33:39 on June 29, 2016 · (Permalink)

You didn't notice the semi-colon. And actually I was wrong, because it's a post decrementation, so it would be -1 or the maximum integer value if it is unsigned.

JudeOutlaw · 1 points · Posted at 14:41:12 on June 29, 2016 · (Permalink)

I just didn't notice it because there's literally no reason to ever do that. my brain glazed over it, assuming that it would be one of the most pointless things to do to utilize it for that purpose.

If you want to add x processor cycles to the assignment of x, instead of just using a single cycle, then by all means. But I can't think of a single reason where that would ever be useful.