Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
How the most upvoted C question was another question (bowero.nl)
2 points by ColinWright on June 10, 2020 | hide | past | favorite | 1 comment


Question is about the "--> operator in C" and why this, surprisingly, works:

  #include <stdio.h>
  int main()
  {
      int x = 10;
      while (x --> 0) // x goes to 0
        printf("%d ", x);
  }
Output is: 9 8 7 6 5 4 3 2 1 0

It is kind of cool that this works!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: