Confusing, what is this inside the channel in Go Routines

102 views Asked by At

Program :

package main
import (
"fmt"
)
func main() {
ch := make(chan int)
fmt.Println(ch)
fmt.Println(0xc000062060)
}

Output :

0xc00009e000
824634122336

What does that output (824634122336) mean? I think (0xc00009e000) is a starting address of an channel.

  • If (0xc00009e000 is address of channel)

    • Then please tell me what is this (824634122336)
  • else

    • Then please tell what are those outputs.
1

There are 1 answers

0
nipuna On

0xc00009e000 is a hexadecimal value of 824634122336. So 824634122336 not a value in the channel.

fmt.Println(0x10) //Output: 16

In software calculations, "0x" prefix adding to represent the hexadecimal numbers.

Refer this why-are-hexadecimal-numbers-prefixed-with-0x