# C語言題庫-009 ``` void getmemory(char *p) { p=(char *) malloc(100); strcpy(p,“hello world”); } int main( ) { char *str=NULL; getmemory(str); printf(“%s/n”,str); free(str); return 0; } ``` 會出現什麼問題? 【標準答案】程序崩潰,getmemory中的malloc 不能返回 動態內存,free ()對str操作很危險。