- 484 名前:デフォルトの名無しさん [2008/02/24(日) 00:18:48 ]
- >>479
それだと、 bin x;を初期化する関数と、適当な配列を入れるとバグるんです なんでうごかないんですか #include <stdio.h> #include <string.h> typedef struct { char **start ; char **end; } bin; void f(bin *x) { delete[] *x->start; *x->start = new char [3]; strcpy(*x->start,"aa"); } void h(bin *x){ char *ch=new char [3]; ch[0]='X';ch[1]=0; x->start=&ch; } main() { bin x; h(&x); f(&x); char *test=new char [1]; printf("%s",*(x.start)); }
|

|