메모리에러

BugDict/C

[C언어]"Error in `./a.out': malloc(): memory corruption (fast): 0x0000000001a1d030"해결

문제상황: C 언어로 개발하던 중 동적할당을 활용한 코드에서 에러가 발생했습니다. 에러가 발생한 코드: #include #include typedef struct { int id; char name[20]; } Employee; int main() { Employee* empList; int empCount = 5; empList = (Employee*)malloc(empCount * sizeof(Employee)); for (int i = 0; i

Bug Detector
'메모리에러' 태그의 글 목록