-5

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.
James Z
  • 12,209
  • 10
  • 24
  • 44
Nellai
  • 1
  • 1
  • 0xc000062060 is 824634122336 in decimal. (So `824634122336` is what you see output when you call `fmt.Println(0xc000062060)`. And yes, printing a chan like that just prints its address. – Darshan Rivka Whittle May 06 '21 at 18:58
  • Ohhh Thanks @DarshanRivkaWhittle, I would like to know about addresses and what is it, why is it, what system is doing with address is different and what can we do with those address, where it will be helpful and I would like to know more insights about address, can you help me? – Nellai May 06 '21 at 19:02
  • @Nellai There is nothing interesting about the address of a channel. You cannot learn anything from that address. – Volker May 07 '21 at 05:04

1 Answers1

1

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

nipuna
  • 3,697
  • 11
  • 24