close
在ptt上的題目.
how many bytes will be allocated ? (Assume one pointer: 4 bytes)

1) char **p;
2) char *p[20];
3) char (*p)[20];
4) char (*p)[20][40];


---
Ans:
1) 4
2) 80
3) 4
4) 4


No 2.
Declares an array of pointer to characters.
array length = 20,
pointer length = 4,
20 * 4 = 80 bytes.

No3,4 宣告是指向維度 [20] 陣列的指標, 指向維度 [20][40] 陣列的指標

arrow
arrow
    全站熱搜

    JohnDX 發表在 痞客邦 留言(0) 人氣()