Created
January 8, 2010 02:37
-
-
Save rdegges/271805 to your computer and use it in GitHub Desktop.
This file contains 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 | |
* | |
* @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