Why does the vector find return the iterator instead of the integer value?
vector<string>::iterator itr1 = std::find(words.begin(), words.end(), word);
std::find works for all sorts of containers, not just std::vector. For example, it works with std::list but that container does not allow accessing elements by index (at least not easily). For it to work with all kinds of containers it needs to return something all containers understand, an iterator.
Edit : If you want to find the index position equivalent to a given iterator, you can use std::distance. For example :
std::distance(std::begin(words), itr1);
This will work for standard containers but it may be slower for some. It returns the size of the container if the element is not found, since find returns end if it fails to find the element and the distance between begin and end is the size of the container.
begin to end, replace begin by the iterator following the last one you found. I don't think the standard library has a function for that.