Created
March 22, 2013 03:47
-
-
Save jharjono/5218814 to your computer and use it in GitHub Desktop.
simple illustration of why C is awesome once you understand it
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
#include <stdio.h> | |
int main() { | |
int a[10]; | |
int i; | |
for (i=0; i < 10; i++) { | |
a[i] = i; | |
} | |
// Simple intro to C trivia: what does the if statement below print? foo or bar? | |
if (a[1] == 1[a]) { | |
printf("foo!\n"); | |
} else { | |
printf("bar\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment