distance : distance « STL Algorithms Helper « C++ Tutorial






#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main( ) {
  vector<int> v;
  v.push_back(0);
  v.push_back(1);
  v.push_back(2);
  cout << v.size( ) << endl;
  cout << distance(v.begin( ), v.end( )) << endl;
}
3
3








32.7.distance
32.7.1.distance
32.7.2.Get the distance between two element in a list