“Variabel pointer pergi” Kode Jawaban

Variabel pointer pergi

var num int = 5

// create the pointer variable
var ptr *int = &num
SAMER SAEID

Variabel pointer pergi

// Program to assign memory address to pointer

package main
import "fmt"

func main() {

  var name = "John"
  var ptr *string

  // assign the memory address of name to the pointer
  ptr = &name

  fmt.Println("Value of pointer is", ptr)
  fmt.Println("Address of the variable", &name)

}
SAMER SAEID

Jawaban yang mirip dengan “Variabel pointer pergi”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya