의외로 출력 결과가 같은 것
C/C++
4767 views · 1 like
#include <stdio.h>
int main() {
printf("Address of main function (using &main): %p\n", &main);
printf("Address of main function (using main): %p\n", main);
return 0;
}Address of main function (using &main): 0x5a9d0d00b169
Address of main function (using main): 0x5a9d0d00b169왜 같은지 자세히는 ㅁ?ㄹ
묵시적으로 &붙은 걸로 해석하는 듯
1
3 comments
hello_world
05/17/25 &main -> 함수 주소, main -> 암묵적 함수 주소
tommy5801
05/17/25 main함수만 적용되는건가
comi-soft
05/19/25 선언한 모든 함수에 적용됨
s/turtleneckers
• 1,620 subscribers프로그래밍 서브입니다. 잡담, 문제 해결, 코드 리뷰(공지 필독)
Created 05/17/2025, 14:30:39
Rules
- 1. 기본 방임주의(절대 귀찮아서 그런 것 맞음)
- 2. 누가봐도 밴 당할법한 글 올리면 자를꺼임
- 3. 카테고리 지켜주면 좋겠지만 안지키면 안타까운거고