Skip to content

Instantly share code, notes, and snippets.

@jstaursky
Last active June 26, 2019 03:26
Show Gist options
  • Save jstaursky/b93a57a812db2d4c529e1e6fe109978d to your computer and use it in GitHub Desktop.
Save jstaursky/b93a57a812db2d4c529e1e6fe109978d to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(int argc, char *argv[])
{
char* Array[2][2] = { { "0th Row, 0th Col", "0th Row, 1st Col"},
{ "1st Row, 0th Col", "1st Row, 1st Col"}};
puts (Array[0][0]);
puts (Array[0][1]);
puts (Array[1][0]);
puts (Array[1][1]);
printf ("\n");
char* (*Arr)[2] = Array;
puts ( *Arr[0] ); // prints 0th Row, 0th Col.
puts ( (*Arr)[0] ); // prints 0th Row, 0th Col.
printf ("\n");
puts ( *Arr[1] ); // prints 1st Row, 0th Col.
puts ( (*Arr)[1] ); // prints 0th Row, 1st Col.
puts ( Arr[1][1] ); // prints 1th Row, 1st Col.
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment