Strange compiler error when counting letters
<p>i made a progra which sum the occurences of a letter in a string , but i get a strange error, which i can't understand. </p>

<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;vector&gt;
#include &lt;algorithm&gt;
using namespace std;

int main()
{
    int sum=0;
    string sir;
    vector&lt;int&gt; num;
    vector&lt;std::string&gt; letters{"a","b","c","d","e","f","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
    getline(cin,sir);
    for(int i = 0; i &lt; letters.size(); i++) {
       sum = std::count(sir.begin(),sir.end(), letters[i]);

    num.push_back(sum);
    sum=0;
    }
    return 0;
}
</code></pre>

<p>and here ar the errors :</p>

<pre><code>    c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\stl_algo.h||In function 'typename std::iterator_traits&lt;_InputIterator&gt;::difference_type std::count(_IIter, _IIter, const _Tp&amp;) [with _IIter = __gnu_cxx::__normal_iterator&lt;char*, std::basic_string&lt;char&gt; &gt;, _Tp = std::basic_string&lt;char&gt;, typename std::iterator_traits&lt;_InputIterator&gt;::difference_type = int]':|
E:\c\Watermelon\main.cpp:15|58|instantiated from here|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\stl_algo.h|4591|error: no match for 'operator==' in '__first.__gnu_cxx::__normal_iterator&lt;_Iterator, _Container&gt;::operator* [with _Iterator = char*, _Container = std::basic_string&lt;char&gt;, __gnu_cxx::__normal_iterator&lt;_Iterator, _Container&gt;::reference = char&amp;]() == __value'|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\stl_algo.h|4591|note: candidates are:|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\functional|2233|note: template&lt;class _Res, class ... _Args&gt; bool std::operator==(std::nullptr_t, const std::function&lt;_Res(_ArgTypes ...)&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\functional|2227|note: template&lt;class _Res, class ... _Args&gt; bool std::operator==(const std::function&lt;_Res(_ArgTypes ...)&gt;&amp;, std::nullptr_t)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\tuple|575|note: template&lt;class ... _TElements, class ... _UElements&gt; bool std::operator==(const std::tuple&lt;_TElements ...&gt;&amp;, const std::tuple&lt;_Elements ...&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\random.h|5322|note: template&lt;class _RealType&gt; bool std::operator==(const std::piecewise_linear_distribution&lt;_RealType&gt;&amp;, const std::piecewise_linear_distribution&lt;_RealType&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\random.h|5080|note: template&lt;class _RealType&gt; bool std::operator==(const std::piecewise_constant_distribution&lt;_RealType&gt;&amp;, const std::piecewise_constant_distribution&lt;_RealType&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\random.h|4841|note: template&lt;class _IntType&gt; bool std::operator==(const std::discrete_distribution&lt;_IntType&gt;&amp;, const std::discrete_distribution&lt;_IntType&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\random.h|4609|note: template&lt;class _RealType&gt; bool std::operator==(const std::extreme_value_distribution&lt;_RealType&gt;&amp;, const std::extreme_value_distribution&lt;_RealType&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\random.h|4434|note: template&lt;class _RealType&gt; bool std::operator==(const std::weibull_distribution&lt;_RealType&gt;&amp;, const std::weibull_distribution&lt;_RealType&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\random.h|4259|note: template&lt;class _RealType&gt; bool std::operator==(const std::exponential_distribution&lt;_RealType&gt;&amp;, const std::exponential_distribution&lt;_RealType&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\random.h|2459|note: template&lt;class _RealType1&gt; bool std::operator==(const std::gamma_distribution&lt;_RealType&gt;&amp;, const std::gamma_distribution&lt;_RealType&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\random.h|3715|note: template&lt;class _IntType&gt; bool std::operator==(const std::geometric_distribution&lt;_IntType&gt;&amp;, const std::geometric_distribution&lt;_IntType&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\random.tcc|1684|note: template&lt;class _RealType1&gt; bool std::operator==(const std::normal_distribution&lt;_RealType&gt;&amp;, const std::normal_distribution&lt;_RealType&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\random.h|3337|note: bool std::operator==(const std::bernoulli_distribution&amp;, const std::bernoulli_distribution&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\random.h|3337|note:   no known conversion for argument 1 from 'char' to 'const std::bernoulli_distribution&amp;'|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\random.h|2798|note: template&lt;class _RealType&gt; bool std::operator==(const std::cauchy_distribution&lt;_RealType&gt;&amp;, const std::cauchy_distribution&lt;_RealType&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\random.h|1906|note: template&lt;class _IntType&gt; bool std::operator==(const std::uniform_real_distribution&lt;_IntType&gt;&amp;, const std::uniform_real_distribution&lt;_IntType&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\random.h|1725|note: template&lt;class _IntType&gt; bool std::operator==(const std::uniform_int_distribution&lt;_IntType&gt;&amp;, const std::uniform_int_distribution&lt;_IntType&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\stl_vector.h|1273|note: template&lt;class _Tp, class _Alloc&gt; bool std::operator==(const std::vector&lt;_Tp, _Alloc&gt;&amp;, const std::vector&lt;_Tp, _Alloc&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\streambuf_iterator.h|194|note: template&lt;class _CharT, class _Traits&gt; bool std::operator==(const std::istreambuf_iterator&lt;_CharT, _Traits&gt;&amp;, const std::istreambuf_iterator&lt;_CharT, _Traits&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\basic_string.h|2460|note: template&lt;class _CharT, class _Traits, class _Alloc&gt; bool std::operator==(const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;, const _CharT*)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\basic_string.h|2448|note: template&lt;class _CharT, class _Traits, class _Alloc&gt; bool std::operator==(const _CharT*, const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\basic_string.h|2434|note: template&lt;class _CharT&gt; typename __gnu_cxx::__enable_if&lt;std::__is_char&lt;_Tp&gt;::__value, bool&gt;::__type std::operator==(const std::basic_string&lt;_CharT&gt;&amp;, const std::basic_string&lt;_CharT&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\basic_string.h|2427|note: template&lt;class _CharT, class _Traits, class _Alloc&gt; bool std::operator==(const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;, const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\allocator.h|127|note: template&lt;class _Tp&gt; bool std::operator==(const std::allocator&lt;_Tp1&gt;&amp;, const std::allocator&lt;_Tp1&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\allocator.h|122|note: template&lt;class _T1, class _T2&gt; bool std::operator==(const std::allocator&lt;_T1&gt;&amp;, const std::allocator&lt;_T2&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\stl_iterator.h|1031|note: template&lt;class _Iterator&gt; bool std::operator==(const std::move_iterator&lt;_Iterator&gt;&amp;, const std::move_iterator&lt;_Iterator&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\stl_iterator.h|1025|note: template&lt;class _IteratorL, class _IteratorR&gt; bool std::operator==(const std::move_iterator&lt;_IteratorL&gt;&amp;, const std::move_iterator&lt;_IteratorR&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\stl_iterator.h|335|note: template&lt;class _IteratorL, class _IteratorR&gt; bool std::operator==(const std::reverse_iterator&lt;_IteratorL&gt;&amp;, const std::reverse_iterator&lt;_IteratorR&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\stl_iterator.h|285|note: template&lt;class _Iterator&gt; bool std::operator==(const std::reverse_iterator&lt;_Iterator&gt;&amp;, const std::reverse_iterator&lt;_Iterator&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\stl_pair.h|201|note: template&lt;class _T1, class _T2&gt; constexpr bool std::operator==(const std::pair&lt;_T1, _T2&gt;&amp;, const std::pair&lt;_T1, _T2&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\postypes.h|218|note: template&lt;class _StateT&gt; bool std::operator==(const std::fpos&lt;_StateT&gt;&amp;, const std::fpos&lt;_StateT&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\ext\new_allocator.h|123|note: template&lt;class _Tp&gt; bool __gnu_cxx::operator==(const __gnu_cxx::new_allocator&lt;_Tp&gt;&amp;, const __gnu_cxx::new_allocator&lt;_Tp&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\stl_iterator.h|805|note: template&lt;class _Iterator, class _Container&gt; bool __gnu_cxx::operator==(const __gnu_cxx::__normal_iterator&lt;_Iterator, _Container&gt;&amp;, const __gnu_cxx::__normal_iterator&lt;_Iterator, _Container&gt;&amp;)|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\stl_iterator.h|799|note: template&lt;class _IteratorL, class _IteratorR, class _Container&gt; bool __gnu_cxx::operator==(const __gnu_cxx::__normal_iterator&lt;_IteratorL, _Container&gt;&amp;, const __gnu_cxx::__normal_iterator&lt;_IteratorR, _Container&gt;&amp;)|
||=== Build finished: 36 errors, 0 warnings ===|
</code></pre>
