(gcc) Multi-Dim Array or Double Pointer for Warning-free Compile

Posted by paul simmons on Stack Overflow See other posts from Stack Overflow or by paul simmons
Published on 2010-03-26T01:01:37Z Indexed on 2010/03/26 1:03 UTC
Read the original article Hit count: 183

Filed under:
|
|

Hi,

I have a function, which is called sometimes with regular, sometimes dynamic arrays.

If I define the function as

function_name(int[10][10] a)

and send int** as a parameter, I get a warning. Opposite, if I declare

function_name(int** a)

and send int[][] as a parameter (after casting) I cannot access to array elements inside function.

What is the correctest way?

© Stack Overflow or respective owner

Related posts about c

    Related posts about pointers