SHARE
TWEET

Untitled

a guest May 19th, 2017 41 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "stdafx.h"
  2. using namespace std;
  3.  
  4. int _tmain(int argc, _TCHAR* argv[])
  5. {
  6. vector<int> vector1;
  7. vector<int>::iterator vector1;
  8.  
  9.  
  10.  
  11. for( int i=0; i < 10; i++ ) vector1.push_back(i);
  12. int total = 0;
  13.     vector1 = vector1.begin();
  14.     while( vector1 != vector1.end() ) {
  15.       total += *vector1;
  16.       ++vector1;
  17. }
  18.  
  19.     cout << "Total=" << total << endl;
  20.     return 0;
  21. }
RAW Paste Data
Want to get better at C++?
Learn to code C++ in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top