Skip to content

Instantly share code, notes, and snippets.

@ivant
Created December 10, 2011 03:18
Show Gist options
  • Save ivant/1454460 to your computer and use it in GitHub Desktop.
Save ivant/1454460 to your computer and use it in GitHub Desktop.
C puzzle (sizeof)
/* What does this program print and why? */
#include <stdio.h>
int main(void) {
int n = sizeof(0)["abcdefghij"];
printf("%d\n", n);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment