2022-09-18:以下 go 语言代码输出什么?A:1;B:15;C:panic index out of range;D:doesn’t compile。 package main import

2022-09-18:以下 go 语言代码输出什么?A:1;B:15;C:panic index out of range;D:doesn’t compile。
复制代码
答案选 D。这道题很多人会选 B。i 处于未使用状态,编译不会通过。

版权声明: 本文为 InfoQ 作者【福大大架构师每日一题】的原创文章。
原文链接:【http://xie.infoq.cn/article/3c2071f9381c8ac6734e9830b】。
本文遵守【CC-BY 4.0】协议,转载请保留原文出处及本版权声明。
评论