How would i use an array ( that is defined in the main() ) in a function? how would i define it?
for example:
Code:
void Function( int grid[4][4] );
int main()
{
int array[4][4];
Function(array[4][4]);
return 0;
}
void Function( int grid[4][4] )
{
printf(" %d %d %d %d\n %d %d %d %d\n %d %d %d %d\n %d %d %d %d\n", grid[0][0], grid[0][1], grid[0][2], grid[0][3], ... , grid[3][3]);
}
this is a watered down version of what im working on, but i need array[4][4] to equal grid[4][4], and all the numbers in the arrays to match up. is this even possible? or will i have to copy and paste the printf line throughout my code whenever it is needed?