Created
July 27, 2010 04:03
-
-
Save rdegges/491711 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* test.c | |
* | |
* 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