Skip to content

Instantly share code, notes, and snippets.

@porterjamesj
Created October 28, 2013 22:20
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 porterjamesj/7205849 to your computer and use it in GitHub Desktop.
Save porterjamesj/7205849 to your computer and use it in GitHub Desktop.
demonstration that static arrays are allocated as contiguous blocks of memory
#include <stdio.h>
int main (int argc, char ** argv) {
int A[10][10];
A[3][3] = 10;
printf("i am ten: %d\n", *(((int*) A)+33));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment