#include?<stdio.h>
int?main()
{ int?a,?b,?c;
a?=?1;
b?=?2;
c?=?3;
char?*arr[]?=?{"good"};
printf("%c\n",?*arr[0]);//輸出?g
printf("%s\n",?*arr);???//輸出good
printf("%c\n",?*arr[1]);//無反應(yīng)?調(diào)試直接顯示segmentation?fault?
return?0;
}我知道指針數(shù)組這樣定義字符串是錯(cuò)誤的 但是我就是想試一下然后輸出*arr[0] 程序可以運(yùn)行 為什么移動(dòng)一個(gè)下標(biāo)后 直接無反應(yīng)了?求助
2 回答

- 2 回答
- 0 關(guān)注
- 1219 瀏覽
添加回答
舉報(bào)
0/150
提交
取消