- 415 名前:デフォルトの名無しさん [2008/02/23(土) 22:02:39 ]
- より短くしました これでも外すと壊れます なぜですか?
#include <string.h> #include <stdio.h> #include <stdlib.h> typedef struct { char **st; char **end; }strdata; f(strdata *q){ char *ch=(char *) malloc(10); strcpy(ch,"abcdef"); q->st=&ch; } g(strdata *zzz){ printf("%s",*(zzz->st)); } main(){ strdata str; f(&str); //char *test=new char [1]; g(&str); }
|

|