まちがった

↓改善したプログラムです

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;
}