Skip to content

Instantly share code, notes, and snippets.

@rdegges
Created January 8, 2010 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdegges/271805 to your computer and use it in GitHub Desktop.
Save rdegges/271805 to your computer and use it in GitHub Desktop.
/*
* test.c
*
* @author: Randall Degges
* @email: rdegges@gmail.com
* @date: 1-7-2009
*
* This example program demonstrates a weird way to reference array elements in C. All
* credit goes to the Stack Overflow 'Strangest language feature' discussion page:
* http://stackoverflow.com/questions/1995113/strangest-language-feature
*/
#include <stdio.h>
int main(int argc, char **argv) {
int arr[10];
arr[0] = 1;
printf("arr[0] = %d\n", arr[0]);
printf("0[arr] = %d\n", 0[arr]);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment