Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[])
- {
- vector<int> vector1;
- vector<int>::iterator vector1;
- for( int i=0; i < 10; i++ ) vector1.push_back(i);
- int total = 0;
- vector1 = vector1.begin();
- while( vector1 != vector1.end() ) {
- total += *vector1;
- ++vector1;
- }
- cout << "Total=" << total << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement