less_retarded_wiki

main page, file list, single page HTML, source, report, wiki last updated on 11/30/22

Downto Operator

In C the so called "downto" operator is a joke played on nubs. It goes like this: Did you know C has a hidden downto operator -->? Try it:

#include <stdio.h>

int main(void)
{
  int n = 20;

  while (n --> 10) // n goes down to 10
    printf("%d\n",n);

  return 0;
}

Indeed this compiles and works. In fact --> is just -- and > operators.


All content available under CC0 1.0 (public domain). Send comments and corrections to drummyfish at disroot dot org.