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
  • 57,407
  • 13
  • 129
  • 202

2 Answers2

4

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

Jabberwocky
  • 45,262
  • 17
  • 54
  • 100
3

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

Amadan
  • 179,482
  • 20
  • 216
  • 275