[ale] This is legal C:

Bjorn Dittmer-Roche bjorn at sccs.swarthmore.edu
Thu Feb 12 10:40:32 EST 2004


Someone sent me this. It's an interesting oddity. Try it on your
favorite C compiler!

	bjorn

--------------------------------------------------

/* Find the strangeness! Spotted on kuro5hin... */
#include <stdio.h>

char *foo[] = {"what", "the", "heck", "is", "this"};

int main(int argc, char **argv)
{
  int j=2;
  printf("Test: %s\n", j[foo]);
  return 0;
}



More information about the Ale mailing list