go中的Itoa、Atoi和iota

1. strcov包中的 ItoaAtoi

  • Itoa (用于将整数转换为字符串)

来源:早期c语言中没有string类型而是用字符数组array表示字符串,所以 Itoa 是缩写于Int to Array

  • Atoi(用于将字符串转换为整数)

来源:Array to Int


2. iota

iota是golang语言的常量计数器,只能在常量的表达式中使用

posted @ 2022-11-24 06:42  誓鼎  阅读(755)  评论(0编辑  收藏  举报