unc main() { a := [2]int{5, 6} b := [3]int{5, 6} if a == b { fmt.Println(“equal”) } else { fmt.Println(“not equal”) } }
- A. compilation error
- B. equal
- C. not equal
在线运行
A [2]int 和 [3]int 在Go中是不同的类型 不能通过 == 运算符对比
./prog.go:8:10: invalid operation: a == b (mismatched types [2]int and [3]int)