y‰SŽÒнŒ}zC/C++Ž ..
[2ch|¥Menu]
335:ƒfƒtƒHƒ‹ƒg‚Ì–¼–³‚µ‚³‚ñ
08/02/23 16:26:11
f(x)‚Ì‚ ‚Æ‚Åstrlen(ch)‚ª1‚ɂȂ邱‚Æ‚ª‚ ‚è‚Ü‚·@‚à‚Æ‚̃\[ƒX‚ðŠÈ—ª‚É‚µ‚Ü‚µ‚½
\‘¢‘Ì‚ðŽQÆ“n‚µ‚µ‚Ä‚à‚¾‚߂łµ‚½@‰º‚ÍŠú‘Ò’Ê‚è‚Ì“®ì‚ð‚µ‚Ü‚·@‰½‚ª‚¢‚¯‚È‚¢‚Ì‚©‚í‚©‚è‚Ü‚¹‚ñ

#include <string.h>
#include <stdio.h>
typedef struct STRDATA{ char *start; char *end;}strdata;

f(strdata x){
delete x.start;
x.start = new char [20];
strcpy(x.start,"++++++++++++++"); }


main(){
char *ch=new char [10]; strcpy(ch,"uuuu");

strdata x;
x.start=ch; x.end=ch+strlen(ch);
f(x);
printf("%s",ch);}


ŽŸƒy[ƒW
ÅVƒŒƒX•\ަ
ƒXƒŒƒbƒh‚ÌŒŸõ
—ÞŽ—ƒXƒŒˆê——
˜b‘è‚̃jƒ…[ƒX
‚¨‚Ü‚©‚¹ƒŠƒXƒg
¥ƒIƒvƒVƒ‡ƒ“‚ð•\ަ
‰É‚‚Ԃµ2ch

4987“ú‘O‚ÉXV/243 KB
’S“–:undef