当前位置:网站首页>Output of STL Vector
Output of STL Vector
2022-07-20 12:40:00 【joker_ 0030】
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
void fun(int);
void STLDo()
{
vector<int> db;
for (int i = 0; i < 10; i++)
{
db.push_back(i);
}
/*vector<int>::iterator ite = db.begin();
for ( ite; ite != db.end(); ite++)
{
cout << *ite << endl;
}*/
for_each(db.begin(), db.end(), fun);
/*for (int i = 0; i < 10; i++)
{
cout << db[i] << endl;
}*/
/*for (int i = 0; i < 10; i++)
{
cout << db.at(i) << endl;
}*/
//cout<<db.back()<<endl; Return tail element .
}
void fun(int i)
{
cout << i << endl;
//cout << i+1<< endl;
}
int main()
{
//STLCapacity();
STLDo();
system("pause");
return 0;
}
// Be careful :reserve() And capacity() Function reallocates capacity , Iterative failure .
边栏推荐
- PriorityQueue -- priority queue (heap)
- 请问下,mysql数据,出现重复消费,需要怎么处理
- Read the paper: (yolov1) you only look once:unified, real time object detection
- 【网络研究院】微软警告针对10,000多个组织的大规模AiTM网络钓鱼攻击
- IDEA注释模板配置
- [exception] exception resolution article format
- Remove the quotation marks that are numbers in the array
- [sklearn error reporting solution] undefined metricwarning: precision is ill defined and being set to 0.0
- 大批程序员被劝退!
- 51单片机之LED灯
猜你喜欢
IPv6 basic
How to apply neural network model to practice - mathematical modeling case of neural network model
Understand the trading volume and turnover rate in one article
Part 14: can bus communication of stm32
Chinese synonymous sentence online converter - Chinese synonymous sentence converter software
Before autumn recruitment, you must read these 8 papers on the recommendation system! [attach thesis materials]
23. Network principle - key protocols in tcp/ip four layer model (2)
[Extension announcement] 2022 International Conference on network and information security (nisecurity 2022)
Hcia-r & s self use notes (11) VRP file system, system management
Beauty live broadcast first use ldr6028 wireless microphone sound quality transmission OTG charging continuous output
随机推荐
这些年我开源的几个小项目
Starbucks may close more U.S. stores in the future due to concerns about the safety of employees
Three leetcode questions corresponding to the basic knowledge of linked list (2)
[exception] exception resolution article format
[golang learning notes 1.7] functions in golang should be used
Microservice - fusing and current limiting
上海证券开户安不安全?
C语言之goto
golang consul 观察者watch
oracle 19c版本中, LogMiner包Continuous_mine功能过时,导致CDC功
请问下,mysql数据,出现重复消费,需要怎么处理
新蓝海“硬防晒”,千亿市场“遮不住”了
Reflective Decoding: Beyond Unidirectional Generation with Off-the-Shelf Languag
Reasons why crontab cannot execute scripts and Solutions
apt的学习
[HDU 6095] Rikka with Competition
powershell和cmd区别
c语言远程连接mysql成功,无法插入数据
Part 14: can bus communication of stm32
phpcms添加多文本属性字段_详细教程