Skip to content

Instantly share code, notes, and snippets.

@eHammarstrom
Created October 18, 2017 18:20
Show Gist options
  • Save eHammarstrom/6ad76384a0609ad159cbfdf6bd418dda to your computer and use it in GitHub Desktop.
Save eHammarstrom/6ad76384a0609ad159cbfdf6bd418dda to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#define LEN (10)
int main()
{
int (*a)[LEN] = calloc(LEN * LEN, sizeof(int*));
for (int i = 0; i < LEN; i++)
for (int j = 0; j < LEN; j++)
a[i][j] = j;
for (int i = 0; i < LEN; i++) {
for (int j = 0; j < LEN; j++) {
printf("%d\t", a[i][j]);
}
printf("\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment