y‰SŽÒнŒ}zC/C++Ž ..
435:ƒfƒtƒHƒ‹ƒg‚Ì–¼–³‚µ‚³‚ñ
08/02/23 22:37:36
>>430
printf("%s",ch);‚ðprintf("%s",x.st);‚Æ‚·‚ê‚΂¢‚¢B
Œ™‚©H
‚¶‚á‚ ‚±‚ê‚łǂ¤‚¾B
#include <string.h>
#include <stdio.h>
typedef struct {
@ @ char *st;
} strdata;
void f(strdata *x) {
@ @ delete x->st;
@ @ x->st = new char[9];
@ @ strcpy(x->st,"++++++");
}
int main() {
@ @ char *ch = NULL;
@ @ strdata x;
@ @ x.st = ch;
@ @ f(&x);
@ @ ch = x.st;
@ @ printf("%s",ch);
@ @ delete[] ch;
@ @ return 0;
}
ŽŸƒy[ƒW‘±‚«‚ð•\ަ1‚ð•\ަÅVƒŒƒX•\ަƒXƒŒƒbƒh‚ÌŒŸõ—ÞŽ—ƒXƒŒˆê——˜b‘è‚̃jƒ…[ƒX‚¨‚Ü‚©‚¹ƒŠƒXƒg¥ƒIƒvƒVƒ‡ƒ“‚ð•\ަ‰É‚‚Ԃµ2ch
4987“ú‘O‚ÉXV/243 KB
’S“–:undef