I'm new to C++ and I've been trying to figure this out for the past two days.
I have to make a function that allows the user to print out a row of the array, using pointer arithmetic to print the data.(starting at column 0 and finishing at 9)
Is it specifically mentioned that you need to use a pointer ?
because you can use the array itself as the pointer (const pointer and do pointer arithmetic). Not sure if you already know this, but just letting you know.
eg:
int a[10][10];
a[1][2]=5;
cout<<*(*(a+1)+2); ==> will print 5
So the series of statements that you have provided prints all the elements in the 0th row.
if you want to write a general function for this you would need to pass the pointer to the function:
void funcToPrintRows( int* tempa ) // Formal argument
{
here use tempa
}