A simple method is to flatten the array and iterate using dimensions.
#include
void print_array(int *arr,int row,int col)
{
int i,j;
for(i=0;i|
This technique works but flattening array might prevent compiler optimizations which in turn might result in slow execution.