구조체 멤버 포인터의 표현 > IT 기술백서

IT 기술백서

직접 알아내거나 검색하기 귀찮아서 모아 둔 것

Go lang | 구조체 멤버 포인터의 표현

본문

[code]

fmt.Println(&user) // 0xc000006f48

fmt.Println(&user.ID) // 0xc0003cf730

fmt.Println(&(user).ID) // 0xc0003cf730

fmt.Println(&(user.ID)) // 0xc0003cf730

[/code]

 

&user.ID, &(user).ID, &(user.ID) 다 동일하다.

댓글 0개

등록된 댓글이 없습니다.

Menu