Hi,
I know the return value of generic search algorithm "find()" is of iterator type. Now how can I output the return value as numeric type? For example:
short myArray[4] = {2,1,3,7};
vector<short>mVec(myArray,myArray+4);
vector<short>::iterator found;
found = find(mVec.begin(),mVec.end(),2);
In this code the variable found will be assigned the "mVec.begin", but can I obtain its numeric counter part,say, 0 instead? How? Thank u in advance.