Go language-address

address

I'm going to write the understanding of Go from the basics of programming!

What is an address?

Computers have something like a work space called memory Variables are recorded in that memory and their location is called an address

Often expressed in hexadecimal, such as "0xc420010230" Hexadecimal is a counting method that increases by 16 when counting numbers.

Get the address

func main() {
  name := "tanabe"
  fmt.Println(name)   //Get value by name
  fmt.Println(&name)  //&Get address by name

//console
tanabe
0xc421100230

To get the address of a variable, use "& variable name" Because the recording location in memory depends on the computer A different address may be output each time the program is executed.

Recommended Posts

Go language-address
Go Language-Basic ❶
Go language-fmt.Scan
Go Language-Functions
Go language-pointer
Go Language-Basic ❷
GO Chokisomemo 1
Go language-iteration
Python with Go
Go language-conditional branching
About Go functions
Go language-standard package
Go class basics
Go language-rand package
About Go Interface
use go module