Skip to content

Instantly share code, notes, and snippets.

@NYiPhoneDeveloper
Created August 22, 2012 17:47
Show Gist options
  • Save NYiPhoneDeveloper/3427873 to your computer and use it in GitHub Desktop.
Save NYiPhoneDeveloper/3427873 to your computer and use it in GitHub Desktop.
// Multidimentional arrays
int n = 2, m = 4;
int matrix[n][m];
int i = 0;
for (unsigned x = 0; x < n; x++)
{
for (unsigned y = 0; y < m; y++)
{
matrix[x][y] = i;
i++;
printf("Index: %d, %d = %d\n", x, y, matrix[x][y]);
}
}
/*
Creating a simple C multidimensional array, assigning it a value, then checking the value
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment