malloc1 C - malloc_ c 메모리 동적할당 C - malloc_ c 메모리 동적할당 // Memory allocation #include #include #include int main(void){int iInput, iMax;int *iStudent = NULL; fputs("Please enter the max number of array :", stdout);scanf_s("%d", &iMax); iStudent = (int *)malloc(iMax * sizeof(int)); for (int i = 0; i < iMax; ++i){printf_s("%2d 번 학생의 점수 입력 : ",i+1);scanf_s("%d", &iInput);iStudent[i] = iInput;}for (int i = 0; i < iMax; ++i){ printf.. 2019. 3. 8. 이전 1 다음