I need to pass a pointer to a two dimensional array to a function but can't get it working, what I've tried:
array definition:
#define BFD_T_CNT 4096
static UINT32 lan_port_bitfield_by_bfd[2][BFD_T_CNT] = {0};
function prototype
int MyFunc(int ncols, int BfdSessionId, UINT32 *puser_ports,
UINT32 *ptdm_ports, UINT32 pPortBitmap[][ncols])
call:
MyFunc(BFD_T_CNT, BfdSessionId, &Cacheuser_ports[BfdSessionId-1],
&Cachetdm_ports[BfdSessionId-1], lan_port_bitfield_by_bfd);
but I keep getting an error that says:
argument type does not match prototype
Why is this and how di I do this otherwise?
EDIT 1
I tried it as suggested by dbush with the prototype as follows:
int MyFunc(int ncols, int BfdSessionId, BITFIELD *puser_ports, BITFIELD *ptdm_ports, UINT32 **pPortBitmap)
and casting lan_port_bitfield_by_bfd into a (UINT32)** when the function is called which compiled but I could not succesfully access thedata within the function, my access looks like if (pPortBitmap[0][BfdSessionId] & (0x01<<port))
and I got an exception error right there. I've tried as mch suggests in the comment to supply ncols & nrows to the function but it would not compile but give me the ** argument type does not match prototype** error again...