다음은 동적 메모리 할당을 통해 구조체 공간을 확보하고 이름과 학번을 입력받아 구조체에 저장하는 C 언어 함수이다. ㉠, ㉡에 들어갈 내용으로 옳게 짝지어진 것은? #include <stdio.h> #include <stdlib.h> struct student{ char name[20]; int id; }; struct student *alloc() { struct student *p; p = ㉠; if(p==NULL){ printf("Memory allocation error."); return p; } printf("Student name?\n"); gets(p->name); printf("Student id?\n"); scanf("%d", ㉡ ); return p; } ㉠ ㉡

정답 4번(struct student *)malloc(sizeof(struct student)) &(p->id)
인사혁신처 공식 최종정답은 4번입니다. 공식 해설은 별도로 제공되지 않았습니다.
공식 문제지와 최종정답을 문항별로 대조한 기출문제입니다. 공식 해설이 제공되지 않은 문항은 정답 근거만 표시합니다.