当前位置:网站首页>2022-06-26: what does the following golang code output? A:true; B:false; C: Compilation error. package main import “fmt“ func main() { type

2022-06-26: what does the following golang code output? A:true; B:false; C: Compilation error. package main import “fmt“ func main() { type

2022-06-27 04:08:00 Fuda scaffold constructor's daily question

2022-06-26: following golang What does the code output ?A:true;B:false;C: Compile error .

package main

import "fmt"

func main() {
    
    type pos [2]int
    a := pos{
    4, 5}
    b := pos{
    4, 5}
    fmt.Println(a == b)
}

answer 2022-06-26:

Answer selection A. Arrays are value types , Equal length , Each element is also equal , Arrays are equal .

 Insert picture description here

原网站

版权声明
本文为[Fuda scaffold constructor's daily question]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/178/202206270351364124.html