Assign Memory to 3D array using triple pointer

后端 未结 5 848
别跟我提以往
别跟我提以往 2021-01-01 05:54

I have to assign memory to a 3D array using a triple pointer.

#include 
int main()
{
    int m=10,n=20,p=30;
    char ***z;
    z = (char***)          


        
5条回答
  •  鱼传尺愫
    2021-01-01 06:24

    You want sizeof(char) not sizeof(char**) as the latter will give you the size of a pointer which on most modern systems will be 4 bytes instead of the 1 you're expecting.

提交回复
热议问题