I have multiple print functions that operate on multidimensional arrays of different sizes.
I would like to write a function masterPrint that would allow me to pass an array to it with rowsize and columnsize. I will be monitoring this post for most the day if you have any further questions I can answer
something like this
Code:
void masterPrint(rowsize,columnsize,arrayname)
{
}
example of use
masterPrint(4,4,matrix);
masterPrint(3,4,dMatrix);
Code:
void matrixPrint()
{
char i=0;
char j=0;
printf( "matrix print:\n");
for (i=0; i < rowend; i++)
{
printf( "row %d=", i);
for (j=0; j < columnend; j++)
{
printf("[%d]", matrix[i][j]);
}
printf("\n");
}
}
void DependenceMatrixPrint()
{
char i=0;
char j=0;
printf( "\nDependence print:\n");
for (i=0; i < 4; i++)
{
printf( "row %d=", i);
for (j=0; j < 3; j++)
{
printf("[%d]", D[i][j]);
}
printf("\n");
}
}
void printReachable()
{
char i;
char j;
for (i=0; i < rowend; i++)
{
printf( "reachable %d=", i);
printf("[%d]", reachable[i]);
printf("\n");
}
}
void printDependence()
{
char i;
char j;
for (i=0; i < rowend; i++)
{
printf( "dependence %d=", i);
printf("[%d]", dependence[i]);
printf("\n");
}
}