当前位置:网站首页>2022-06-30:以下golang代码输出什么?A:0;B:2;C:运行错误。 package main import “fmt“ func main() { ints := make
2022-06-30:以下golang代码输出什么?A:0;B:2;C:运行错误。 package main import “fmt“ func main() { ints := make
2022-06-30 22:06:00 【福大大架构师每日一题】
2022-06-30:以下golang代码输出什么?A:0;B:2;C:运行错误。
package main
import "fmt"
func main() {
ints := make([]int, 1)
ints = append(ints, 2)
fmt.Println(ints[0])
}
答案2022-06-30:
答案选A。注意 ints := make([]int, 1) 创建的是一个长度为 1 的 slice,第一个元素是 int 的默认值。
边栏推荐
- Summary of errors reported when using YML file to migrate CONDA environment
- Develop technology - get time 10 minutes ago
- Is Wu Enda's machine learning suitable for entry?
- Using Obsidian with Hugo, markdown's local editing software is seamlessly connected with online
- 从PG15 XID64再次跳票说起
- Apache服务器OpenSSL升级
- How to judge whether the JS object is empty
- 顺祝老吴的聚会
- Golang application ━ installation, configuration and use of Hugo blog system
- Gartner focuses on low code development in China how UNIPRO practices "differentiation"
猜你喜欢
Usbcan analyzer's supporting can and canfd comprehensive test software lkmaster software solves engineers' can bus test problems
Nansen double disk encryption giant self rescue: how to prevent the collapse of billions of dominoes
Troubleshooting the problem of pytorch geometric torch scatter and torch spark installation errors
dba
Rethink healthy diet based on intestinal microbiome
牛逼|珍藏多年的工具让我实现了带薪摸鱼自由
Why does the computer speed slow down after vscode is used for a long time?
About, Qianxin detects code vulnerabilities and XSS series solves them
Jupyter notebook/lab switch CONDA environment
WinDbg debugging tool introduction
随机推荐
Ml & DL: Introduction à l’optimisation des hyperparamètres, indice d’évaluation, phénomène de surajustement et introduction détaillée aux méthodes d’optimisation des paramètres couramment utilisées da
1-17 express Middleware
Web APIs comprehensive case -tab column switching - dark horse programmer
How to judge whether the JS object is empty
What are database OLAP and OLTP? Same and different? Applicable scenarios
[introduction to MySQL] the first conversation · first time in the "database" Mainland
Summary of interesting websites
RP prototype resource sharing - shopping app
Turn: win others' follow with practical actions
[backtracking] full arrangement II leetcode47
PostgreSQL存储结构浅析
Installing jupyter notebook under Anaconda
Excitatory neurotransmitter glutamate and brain health
Win11如何优化服务?Win11优化服务的方法
电脑设备管理器在哪里可以找到
How to upload binary pictures in uniapp
Pytorch quantitative practice (2)
Based on the open source stream batch integrated data synchronization engine Chunjun data restore DDL parsing module actual combat sharing
Deployment and use of Nacos
Development techniques - import files using easyexcel (simple example)