#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct{
        char name[20];
        int score;
} STUDENT;

void main(){

        STUDENT st[3],*sp;
        int i=0;

        sp = (STUDENT*)malloc(sizeof(STUDENT));

        if(sp == NULL) {
                printf(\"allocation error.\\n\");
                exit(-1);
        }

        while (i < 3){
                printf(\"Please enter name & score: \");
                scanf(\"%s %d\",sp->name,sp->score);
                strcpy (st[i].name,sp->name);
                st[i++].score = sp->score;
        }

        free(sp);
        
        for(i=0;i<3;i++)
                printf(\"student name: %s,\\tscore: %d\\n\",st[i].name,st[i].score);
}


한줄하고나니 바로 out..

뭐 때문에 오류가떳는지 알수있음 좋으련만..