Skip to content

Instantly share code, notes, and snippets.

@jharjono
Created March 22, 2013 03:47
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 jharjono/5218814 to your computer and use it in GitHub Desktop.
Save jharjono/5218814 to your computer and use it in GitHub Desktop.
simple illustration of why C is awesome once you understand it
#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