생활
구조체 불완전한 형식에 대해서 궁금합니다
#include <stdio.h>
#include <stdlib.h>
typedef struct STUDENT studentInfo;
struct student {
char name[50];
int korean;
int eng;
int math;
int total;//합계
int order;//입력순서
double average;
};
void upSort(studentInfo* info, int student);
void downSort(studentInfo* info, int student);
int main() {
int student = 0;
studentInfo* info = 0;
printf("프로그램 시작 전 학생수를 입력 : ");
scanf_s("%d", &student);
info = (studentInfo)malloc(sizeof(studentInfo) student);
}
프로그램 만드던 도중에 malloc에 있는 studentInfo쪽이 게속 오류가 뜹니다.
인터넷에서 뒤져서 다른사람들이 하는건 잘 되던데 저는 왜 안되는지를 모르것네요;
1개의 답변이 있어요!