Skip to content
Discussion options

You must be logged in to vote

로컬 변수의 주소를 반환하는 경우, 컴파일 오류가 발생하지는 않지만 정의되지 않은 동작(Undefined Behavior)으로 이어집니다. 테스트로 주어지는 프로그램들은 0으로 나누기(division by zero)나 널 포인터 역참조(null dereference)를 제외하고는 다른 오류나 정의되지 않은 동작을 포함하지 않습니다.


Returning the address of a local variable may not cause a compile-time error, but it results in undefined behavior at runtime. The test programs may include division-by-zero and null dereference errors, but will not contain any other types of errors or undefined behavior.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SangjunKo
Comment options

Answer selected by SangjunKo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants