【初心者歓迎】C/C++室 Ver.49【環境依存OK】at TECH
【初心者歓迎】C/C++室 Ver.49【環境依存OK】 - 暇つぶし2ch487:デフォルトの名無しさん
08/02/24 00:24:26
>>484
じゃあこれでいいだろう
#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"); } 

char *ch;
void h(bin *x){ 
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)); 
}


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch