Skip to content

Instantly share code, notes, and snippets.

@EvanCarroll
Last active August 16, 2018 21:03
Show Gist options
  • Save EvanCarroll/ee2d2310f6dc7320bc296ebc15b9fd45 to your computer and use it in GitHub Desktop.
Save EvanCarroll/ee2d2310f6dc7320bc296ebc15b9fd45 to your computer and use it in GitHub Desktop.
Why C is impossible to teach?
#include <stdio.h>
int a[2][2] = {{1,2},{3,4}};
int (*b)[2] = a;
int main () {
printf("%d\n", *b[1]);
printf("%d\n", (*b)[1]);
printf("%d\n", (*b+1)[1]);
printf("%d\n", (*(b+1))[1]);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment