08/02/24 00:03:07
>>475
>>471ではdeleteやnewが効かない場合があるんです これはちゃんと表示されますか?
#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"); }
main() {
char *ch = NULL;
bin x;
x.start=ch;
f(&x);
printf("%s",ch);}