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?
CodePudding user response:
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.