struct a{
int age;
char name[101];
};
int main(void) {
int i, n;
scanf("%d", &n);
struct a *person = malloc(sizeof(struct a)*n);
for(i=0; i<n; i++)
scanf("%d %s", (person+i)->age, (person+i)->name);
...
여기서 자꾸 segfault 런타임에러가 뜨는데 왜 그러는지 모르겟음..
구조체 a 선언해서 person에 a*n 만큼 메모리 할당하고 age랑 name 받는건데 어디서 잘못된걸까
넌 age가 주소니? &(person...age ok? - dc App
오... 성님 감사합니다 베리땡큐