我在 C 方面有一些经验,而且我对 golang 完全陌生。
func learnArraySlice() {
intarr := [5]int{12, 34, 55, 66, 43}
slice := intarr[:]
fmt.Printf("the len is %d and cap is %d \n", len(slice), cap(slice))
fmt.Printf("address of slice 0x%x add of Arr 0x%x \n", &slice, &intarr)
}
现在在 golang 切片中是一个数组引用,它包含指向切片数组 len 和切片上限的指针,但该切片也将分配在内存中,我想打印该内存的地址。但无法做到这一点。
慕桂英546537
慕森王
java怎么打印每个对象的内存地址呢?hashcode能代表内存地址的不同吗?
golang中的切片不分配任何内存?
请问JavaScript 里面怎么获取某个变量的内存地址?并打印出来
如何在Python中让两个print函数的输出打印在一行内
相关分类