当前位置:网站首页>For (Auto A: b) and for (Auto & A: b) usage
For (Auto A: b) and for (Auto & A: b) usage
2022-07-02 19:51:00 【My. Chicken with vegetables for scientific research】
The difference between the two usages
- for(auto a:b) in b For a container , The effect is to use a Traverse and get b Every value in the container , however a Can't affect b Elements in the container .
- for(auto &a:b) A reference symbol is added in the , You can assign values to the contents of the container , Through a Assignment to do container b Fill in the content of .
Test code
#include<iostream>
using namespace std;
int main()
{
int i[10]
边栏推荐
- SQLite 3.39.0 发布,支持右外连接和全外连接
- rxjs Observable 自定义 Operator 的开发技巧
- 【Hot100】22. 括号生成
- AcWing 1129. 热浪 题解(最短路—spfa)
- 外包干了三年,废了...
- HDL design peripheral tools to reduce errors and help you take off!
- AcWing 1125. Cattle travel problem solution (shortest path, diameter)
- 良心总结!Jupyter Notebook 从小白到高手,保姆教程来了!
- Zabbix5 client installation and configuration
- Detailed tutorial on installing stand-alone redis
猜你喜欢
为什么我对流程情有独钟?
Istio1.12:安装和快速入门
AcWing 340. Solution to communication line problem (binary + double ended queue BFS for the shortest circuit)
Implementation of online shopping mall system based on SSM
嵌入式(PLD) 系列,EPF10K50RC240-3N 可编程逻辑器件
Detailed tutorial on installing stand-alone redis
Registration opportunity of autowiredannotationbeanpostprocessor in XML development mode
ShardingSphere-JDBC5.1.2版本关于SELECT LAST_INSERT_ID()本人发现还是存在路由问题
Yes, that's it!
KT148A语音芯片使用说明、硬件、以及协议、以及常见问题,和参考代码
随机推荐
多态的理解以及作用
Understanding and function of polymorphism
AcWing 1135. Happy New Year (shortest path + search)
sql-labs
NMF-matlab
MySQL
Kt148a voice chip IC user end self replacement voice method, upper computer
Common problems and description of kt148a voice chip IC development
Idea editor removes SQL statement background color SQL statement warning no data sources are configured to run this SQL And SQL dialect is not config
开始练习书法
在消费互联网时代,诞生了为数不多的头部平台的话
Chapter 7 - class foundation
CRM客户关系管理系统
Istio1.12: installation and quick start
Overview of browser caching mechanism
Py之interpret:interpret的简介、安装、案例应用之详细攻略
What is the Bluetooth chip ble, how to select it, and what is the path of subsequent technology development
Implementation of online shopping mall system based on SSM
AcWing 341. Optimal trade solution (shortest path, DP)
c语言链表--待补充