Skip to content
小飞侠
  • 首页
  • 小程序
  • uniapp
  • vue
  • APICloud
  • 其他
菜单

博客

  1. 首页>
  2. 其他>
  3. for(auto &a :b)

for(auto &a :b)

  • Post author:xfxia
  • Post published:2023年9月25日
  • Post category:其他


C++11新标准。

auto推导类型。

int arr[10];
for(int i=0;i<10;i++)
{
  arr[i]=i;
}
for(auto &a:arr)
{
  std::cout << a;
}

输出的结果就是0—9这十个数。

for(auto &a : arr)中“auto &a”就是变量名就和上一个for循环中的“int i”一样,

与for(int i=0;i<sizeof(arr);i++)是一样的。


https://blog.csdn.net/iv__vi/article/details/79806683


你可能也喜欢

oracle数据库

字符串补齐

如何拿到一个图片的二进制数据

EF监听生成的所有sql语句(包括插入,删除sql)

Ghost 使用手册

《C++面向对象程序设计》课程笔记 lessen2

JS常用API汇总

地图坐标系统(各种坐标系详解)

Artifact 01_web:war exploded: Error during artifact deployment. See server log for details.

QT显示一个窗体,show()函数和exec()函数有什么区别?

0505-使用Apache Hive3实现跨数据库的联邦查询

issacgym+leggedgym安装

pkg-config –modversion opencvPackage opencv was not found in the pkg-config search path.Perhaps y

异步方法之promise

如何使用Git工具克隆GitHub仓库到本地

手把手教你使用start uml画用例图

SVN报 “证书的主机名称不匹配” “证书发生未知错误”

常见损失函数

hdu1269迷宫城堡

张量模型并行详解 | 深度学习分布式训练专题

目录

  • APICloud (3)
  • golang (228)
  • java (8,236)
  • linux (4,002)
  • mysql (2,800)
  • php (1,070)
  • python (5,439)
  • solidity (25)
  • uniapp (235)
  • vue (2,463)
  • 其他 (88,233)
  • 小程序 (801)

文章归档

  • 2023年十二月 (1872)
  • 2023年十一月 (477)
  • 2023年十月 (17371)
  • 2023年九月 (44974)
  • 2023年八月 (26399)
  • 2023年七月 (14793)
  • 2023年六月 (1)
  • 2023年五月 (2186)
  • 2023年四月 (3838)
  • 2023年三月 (1544)
  • 2023年二月 (3)
  • 2023年一月 (4)
  • 2022年十二月 (3)
  • 2022年十一月 (36)
  • 2022年十月 (16)
  • 2022年九月 (8)
  • 2021年九月 (1)
  • 2020年九月 (6)
  • 2020年八月 (5)

标签

Aave (1) cosmos (6) defi (255) flag (27) gitee (1) github (1) golang (234) java (8234) linux命令 (82) List (1) map (1115) mysql (3093) npm (237) tendermint (6) uuid (43) vant (64) vmware (270) 区块链 (63) 合约 (37) 小程序版本更新 (3)
  • 首页
  • 小程序
  • uniapp
  • vue
  • APICloud
  • 其他
Copyright xfxia.com 鲁ICP备19024253号-2
关闭菜单