강의

멘토링

로드맵

Inflearn Community Q&A

och98540274's profile image
och98540274

asked

Hong Jung-mo's C Programming: Learning by Doing (Appendix)

17.7 Interface Application Cases

finditembyindex 질문드립니다!

Written on

·

347

0


위 함수에서, Item** item 이중포인터로 받아오는 이유를 여쭤봐도 될까요??
 
제가 생각한 것은 Item* item을 변수로 받고, 219번 line을 item = &pnode -> item; 으로 해도 문제가 없을 것이라고 생각하는데, 어떤 개념을 놓치고 있는지 알고 싶습니다 감사합니다
c

Quiz

51% of people got it wrong. Give it a try!

When comparing arrays and linked lists, which data structure is more efficient for data insertion or deletion?

Array

Linked list

Stack

Q

Answer 1

0

안녕하세요,

포인터를 인자로 전달하는 것과 일반적인 값을 인자로 전달하는 것에는 차이가 있습니다.

Item * 의 주소를 전달하는 이유는 

item의 값을 복사하여 수정할 것이 아닌

item이 주소값을 토대로 저장되어 있는 값을 수정하기 위함입니다.

 

och98540274's profile image
och98540274

asked

Ask a question