【初心者歓迎】C/C++室 Ver.49【環境依存OK】at TECH
【初心者歓迎】C/C++室 Ver.49【環境依存OK】 - 暇つぶし2ch479:デフォルトの名無しさん
08/02/24 00:07:28
>>477
じゃあもういいから、こうしとけ
#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 g(bin *x) {
delete[] *x->start; 
*x->start = new char [3]; 
strcpy(*x->start,"bb"); } 

main() { 
char *ch = NULL; 
bin x; 
x.start=&ch; 
f(&x); 
printf("%s",ch);
g(&x); 
printf("%s",ch);
}
これで終了、もう来るな


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