C++ 程式設計中的輸出迭代器
在本教程中,我們將討論一個程式來理解 C++ 中的輸出迭代器。
輸出迭代器是五個主要迭代器的一部分。它們與輸入迭代器相反,可以為其分配值,但不能訪問以獲取值。
示例
#include<iostream>
#include<vector>
using namespace std;
int main(){
vector<int>v1 = {1, 2, 3, 4, 5};
//declaring iterator
vector<int>::iterator i1;
for (i1=v1.begin();i1!=v1.end();++i1){
*i1 = 1;
}
return 0;
}輸出
No output, because we cannot access values of output operators
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP