More 2D array with pointers

S

Super KHB

I am still trying to display 2D arrays with pointers.

My prof gave us the prototype

void DisplayArray (int (*)[int];

where inside the function DisplayArray(array)
*(*(array + row) + col) would be the same as array[row][col]

But it does not even accept the prototype. Please help!
 
V

Victor Bazarov

Super KHB said:
I am still trying to display 2D arrays with pointers.

My prof gave us the prototype

void DisplayArray (int (*)[int];

The closing parenthesis is missing and the dimension:

void DisplayArray(int (*)[???]);

I can add the parenthesis, but the dimension is unknown to me.
where inside the function DisplayArray(array)
*(*(array + row) + col) would be the same as array[row][col]

But it does not even accept the prototype. Please help!
 
J

John Harrison

Super KHB said:
I am still trying to display 2D arrays with pointers.

My prof gave us the prototype

void DisplayArray (int (*)[int];

That is not a legal prototype. If that is what your prof really gave you
then you need to go back to him and ask for some legal code. Its also not
the same as the prototype you posted earlier.
where inside the function DisplayArray(array)
*(*(array + row) + col) would be the same as array[row][col]

But it does not even accept the prototype. Please help!

I think perhaps you need to explain clearly what you have been asked to do.
Without a proper explanation you are only going to get solutions to problems
that approximate to the problem you are actually trying to solve.

john
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,183
Messages
2,570,968
Members
47,517
Latest member
TashaLzw39

Latest Threads

Top