当前位置:网站首页>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]边栏推荐
- AcWing 1135. 新年好 题解(最短路+搜索)
- 【Hot100】23. 合并K个升序链表
- Py之interpret:interpret的简介、安装、案例应用之详细攻略
- AcWing 181. 回转游戏 题解(搜索—IDA*搜索)
- Data Lake (XII): integration of spark3.1.2 and iceberg0.12.1
- Pytorch版本、CUDA版本与显卡驱动版本的对应关系
- Implementation of online shopping mall system based on SSM
- NMF-matlab
- Self-Improvement! Daliangshan boys all award Zhibo! Thank you for your paper
- upload-labs
猜你喜欢

Introduction to program ape (XII) -- data storage

One side is volume, the other side is layoff. There are a lot of layoffs in byte commercialization department. What do you think of this wave?

浏览器缓存机制概述

Zabbix5 client installation and configuration

Data Lake (XII): integration of spark3.1.2 and iceberg0.12.1

外包干了三年,废了...

KT148A语音芯片ic的用户端自己更换语音的方法,上位机

How to avoid duplicate data in gaobingfa?

为什么我对流程情有独钟?

数据湖(十二):Spark3.1.2与Iceberg0.12.1整合
随机推荐
Embedded (PLD) series, epf10k50rc240-3n programmable logic device
Chapter 7 - class foundation
AcWing 343. Sorting problem solution (Floyd property realizes transitive closure)
AcWing 383. Sightseeing problem solution (shortest circuit)
Data Lake (XII): integration of spark3.1.2 and iceberg0.12.1
Function high order curry realization
Common problems and description of kt148a voice chip IC development
JS how to get integer
AcWing 1125. Cattle travel problem solution (shortest path, diameter)
Understanding and function of polymorphism
Automatically generate VGg image annotation file
Solution: vs2017 cannot open the source file stdio h main. H header document [easy to understand]
简书自动阅读
Kt148a voice chip IC user end self replacement voice method, upper computer
[Chongqing Guangdong education] reference materials for labor education of college students in Nanjing University
JASMINER X4 1U深度拆解,揭开高效省电背后的秘密
AcWing 903. 昂贵的聘礼 题解(最短路—建图、dijkstra)
NMF-matlab
Correspondence between pytoch version, CUDA version and graphics card driver version
esp32c3 crash分析