- 128 名前:デフォルトの名無しさん [2007/11/02(金) 20:20:22 ]
- まちがった
↓改善したプログラムです void myalloc(char **p1, char **p2) { *p1 = malloc(20); strcpy(*p1, "first string"); *p2 = malloc(20); strcpy(*p2, "second string"); } int main(void) { char *p1; char *p2; myalloc(&p1,&p2); printf("p1=%s p2=%s\n", p1, p2); return 0; }
|

|