英文:
What does the hexadecimal value obtained by printing the name of a function mean?
问题
在下面的代码中,我创建了两个函数someFunction1
和someFunction2
:
package main
import (
"fmt"
)
func someFunction1() {}
func someFunction2() {}
func main() {
fmt.Println(someFunction1) // 0x7de480
fmt.Println(someFunction2) // 0x7de4a0
}
通过打印它们,我得到了两个十六进制值0x7de480
和0x7de4a0
。我的问题很简单,这些值代表什么意思?
英文:
In the following code I have created two functions someFunction1
and someFunction2
:
package main
import (
"fmt"
)
func someFunction1() {}
func someFunction2() {}
func main() {
fmt.Println(someFunction1) // 0x7de480
fmt.Println(someFunction2) // 0x7de4a0
}
By printing them I got two hexadecimal values 0x7de480
and 0x7de4a0
. My question is simple, what do these values mean?
答案1
得分: 3
这些十六进制值是函数someFunction1和someFunction2的内存地址。它们表示函数在计算机内存中的位置。这意味着someFunction1存储在内存地址0x7de480,而someFunction2存储在内存地址0x7de4a0。
英文:
These hexadecimal values are the memory addresses of the two functions someFunction1 and someFunction2. They indicate the location of the functions in the computer's memory. This means that someFunction1 is stored at memory address 0x7de480 and someFunction2 is stored at memory address 0x7de4a0.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论