How do I iterate through a string contained in a vector? <p>For clarity, I am not asking how to iterate through a vector of strings (which is what all of my searches turn up), I want to iterate through a string contained in a vector of strings. I'm running into linker errors when trying to assign the string iterator a value from a string in a vector. </p> <p>The code below takes a reference to a const vector of strings. The purpose of the function is to reverse the order of the letters and the elements so if you passed in a vector of strings containing { "abc", "def", "ghi" } it would reorder them and return a vector of strings containing { "ihg", "fed", "cba" }. It should be noted that the function is declared as static in the header file. I'm running into a problem when I try to attempt to initialize the string iterator in the for loop. I get a linker error:</p> <pre><code>"No matching constructor for initialization of 'std::__1::__wrap_iter&lt;char*&gt;' </code></pre> <p>I thought accessing rbegin() through the -> from the vector iterator would work but... I'm stumped. Why does stringsVectorIterator->rend() cause a linker error when assigned to string::reverse_iterator rit?</p> <pre><code>vector&lt;string&gt; StringUtility::reverse(const vector&lt;string&gt; &amp;strings) { // Create a vector of strings with the same size vector as the one being passed in. vector&lt;string&gt; returnValue( strings.size() ); vector&lt;string&gt;::const_reverse_iterator stringsVectorIterator; size_t returnVectorCounter; for (stringsVectorIterator = strings.rbegin(), returnVectorCounter = 0; stringsVectorIterator != strings.rend(); stringsVectorIterator++, returnVectorCounter++) { // the problem is in the initialization of the string iterator, it creates // a linker error. for (string::reverse_iterator rit = stringsVectorIterator-&gt;rbegin(); rit != stringsVectorIterator-&gt;rend(); ++rit) { returnValue[returnVectorCounter].push_back(*rit); } } return returnValue; }; </code></pre>