saur
Member level 2
In a code that I've come across,
First they 've defined NUM_RX_BUF and NUM_TX_BUF as 4 and ETH_BUF_SIZE as 1536.
Then I've defined "static unsigned int rx_buf[NUM_RX_BUF][ETH_BUF_SIZE>>2]"
But in the main function the use rx_buf as follows:
"Rx_Desc.Addr = (U32)&rx_buf;";
where Rx_Desc is an member of an array of structure type.
i is a variable of unsigned int datatype.
U32 has been defined as unsigned int using typedef.
My doubt is, can the address of a member of the array rx_buf be obtained by passing just one argument to rx_buf while its a 2-D array?
I thought 2-D arrays always require two arguments (rows) and (columns).
Hope someone could clarify my doubt.
Thanks.
First they 've defined NUM_RX_BUF and NUM_TX_BUF as 4 and ETH_BUF_SIZE as 1536.
Then I've defined "static unsigned int rx_buf[NUM_RX_BUF][ETH_BUF_SIZE>>2]"
But in the main function the use rx_buf as follows:
"Rx_Desc.Addr = (U32)&rx_buf;";
where Rx_Desc is an member of an array of structure type.
i is a variable of unsigned int datatype.
U32 has been defined as unsigned int using typedef.
My doubt is, can the address of a member of the array rx_buf be obtained by passing just one argument to rx_buf while its a 2-D array?
I thought 2-D arrays always require two arguments (rows) and (columns).
Hope someone could clarify my doubt.
Thanks.