K
Kitty
Is it possible to know the relative position of a given element, say x, in
the container? Assume x is unique.
For example,
vector<int> v;
v.push_back(10);
v.push_back(20);
v.push_back(30);
v.push_back(40);
v.push_back(50);
Then the position of element 50 relative to 20 is +3. Actually, how to find
this relative position? Thanks.
the container? Assume x is unique.
For example,
vector<int> v;
v.push_back(10);
v.push_back(20);
v.push_back(30);
v.push_back(40);
v.push_back(50);
Then the position of element 50 relative to 20 is +3. Actually, how to find
this relative position? Thanks.