2

I have a question, what mean "-->" in C? For example:

int a, b, c, x;
a=2001;
b=1000;
c=2;
x=a-b*c;
printf("First: %i", x-->0);

It will print "1". But:

printf("Second: %i", x-->0);

will print "0". Why when I use it second time, it print "0"?

user2864740
  • 60,010
  • 15
  • 145
  • 220

2 Answers2

4

x --> 0 is to be read (x--) > 0.

Jabberwocky
  • 48,281
  • 17
  • 65
  • 115
3

x-->0 is parsed as (x--) > 0.

Amadan
  • 191,408
  • 23
  • 240
  • 301