What is the difference between the following declarations in C?

后端 未结 4 1645
孤街浪徒
孤街浪徒 2021-01-15 06:44

what\'s the difference between these 2 declarations:

char (*ptr)[N];

vs.

char ptr[][N];

thanks.

4条回答
  •  忘掉有多难
    2021-01-15 07:16

    The first declares a pointer to an N-long array, the other declares an two dinemsional array. Note: They can be used to achieve the similar functionality, but they don't mean the same!

提交回复
热议问题