sách gpt4 ăn đã đi

go - Go 中 Print 和 print 的区别

In lại 作者:数据小太阳 更新时间:2023-10-29 03:44:43 24 4
mua khóa gpt4 giày nike

<分区>

Go 语言中的 fmt.Print("print something") 和 just print("print something") 之间有什么区别。

đã đi đến int
fmt.Print("In Print ", &a, "\n ")
print("In print ", &a, "\n")

两者提供相同的结果。

kết quả:

In Print 0xcSameAddressLocation
In print 0xcSameAddressLocation

但是当我这样做时:

ar := []int{1, 2, 3, 4, 5, 6, 7, 8}
print("In print ", &ar, "\n")
print("In print ", ar[0], "\n")
print("In print ", ar, "\n")
fmt.Print("In fmt.Print ", &ar, "\n")
fmt.Print("In fmt.Print ", &ar[0], "\n")
fmt.Print("In fmt.Print ", ar[0], "\n")
fmt.Print("In fmt.Print ", ar, "\n")

kết quả:

In print 0xcAddressLocation1
In print 1
In print [8/8]0xcAddressLocation2
In fmt.Print &[1 2 3 4 5 6 7 8]
In fmt.Print 0xcAddressLocation2
In fmt.Print 1
In fmt.Print [1 2 3 4 5 6 7 8]

有人可以问一下它是如何工作的以及“print()”和“fmt.Print()”分别在 Go 语言中做了什么。

24 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress