S
Super KHB
I know that I am close, but it wont work. HELP!!!!
void PrintA( int * , int);
void main()
{
int num[3][5] = {
{1, 2,3,4,5},
{6,7,8,9,10},
{11,12,13,14,15},
};
int *num_ptr;
num_ptr = &num[0][0];
PrintA( num_ptr, 5 );
}
void PrintA( int *a, int cols )
{
for (int r = 0; r < 3 ; r++)
{for ( int c = 0; c < 5; c++ )
cout << *(*(a + r) + c) << " ";
cout << endl;
}
}
void PrintA( int * , int);
void main()
{
int num[3][5] = {
{1, 2,3,4,5},
{6,7,8,9,10},
{11,12,13,14,15},
};
int *num_ptr;
num_ptr = &num[0][0];
PrintA( num_ptr, 5 );
}
void PrintA( int *a, int cols )
{
for (int r = 0; r < 3 ; r++)
{for ( int c = 0; c < 5; c++ )
cout << *(*(a + r) + c) << " ";
cout << endl;
}
}