#include<stdio.h>
#include<string.h>
struct A{
char *s;
int i;
};
struct B{
struct A *a;
};
int w(struct B *aB){
printf("(%s)(%d)",aB->a->s, aB->a->i);
return 0;
}
int q(struct B *aB){
printf("%s", __FUNCTION__);
struct A *sA = aB->a;
printf("%s", __FUNCTION__);
sA->s = strdup("helloo"); <-- ¿©±×¼ ¿¡·¯.... ³ª´Âµ¥¿ä ¾î¶»°Ô ó¸®Çϸé ÁÁÀ»±î¿ä?
sA->i = 12;
w(aB);
return 0;
}
void assign(struct B *aB){
aB = (struct B *) malloc(sizeof(struct B));
}
int main(){
struct B sB;
assign(&sB);
q(&sB);
return 0;
}
Àâ´ã | 1420¸íÀÌ Àоú¾î¿ä. 18.226.180.68