강의

멘토링

커뮤니티

Inflearn Community Q&A

heavylight's profile image
heavylight

asked

Professor Park's Advanced C Course

Creating a linked list 1

연결리스트만들기1 예제에서 free();

Written on

·

208

0

free(new_node); 이걸 안해도 되는 건가요? scanf("%d\n", &n) != EOF에 10개의 정수를 넣어주면 while문이 10번 반복될텐데, 동적할당해준 메모리를 return 0; 앞에서 한번만 free(new_node);를 통해서 해제해주면, 나머지 9번 할당받은 메모리는 어떻게 되는 걸까 하는 생각이 들어서 질문 드립니다.
c

Answer

This question is waiting for answers
Be the first to answer!
heavylight's profile image
heavylight

asked

Ask a question