Open
Conversation
해당 문제(11번 문제)는 함수에 작동되는 call by reference와 call by value에 대한 내용입니다. 개인 공부하는 과정에서 포인터 변수는 call by value이며, "주소값을 복사해서 가져오는 것"이기에 call by reference처럼 보인다는 사실을 알게 되었습니다. 그래서 해당 문제를 만들게 되었고, 다음은 주관적인 해설입니다. - 둘 다 call by reference를 이용한 함수라고 할 수 있지만, 정확히는 아니다. - 포인터 변수를 입력 파라미터로 한 함수는 "주소값을 복사해서 가져오는 것"이기 때문에 call by value라고 봐야 한다. 이 때문에 call by reference가 되는 것처럼 보이는 것이다. - 참조 변수를 입력 파라미터로 한 함수는 말 그대로 값을 가리켜 참조하는 것이기에, call by reference라고 볼 수 있다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
해당 문제(11번 문제)는 함수에 작동되는 call by reference와 call by value에 대한 내용입니다.
개인 공부하는 과정에서 포인터 변수는 call by value이며, "주소값을 복사해서 가져오는 것"이기에 call by reference처럼 보인다는 사실을 알게 되었습니다.
그래서 해당 문제를 만들게 되었고, 다음은 주관적인 해설입니다.
이 때문에 call by reference가 되는 것처럼 보이는 것이다.