Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
string in;
string alpha="abcdefghijklmnopqrstuvwxyz";
string mix="";
int sum[26];

for(int i=0;i<26;i++){
sum[i]=0;
}

while(1){
in="";
cin>>in;
if(in=="")break;
mix=mix+in;
}

int a;
a=mix.length();

for(int i=0;i<a;i++){

if(mix[i]="a"){
sum[0]++;
}else if(mix[i]="b"){
sum[1]++;
}else if(mix[i]="c"){
sum[2]++;
}else if(mix[i]="d"){
sum[3]++;
}else if(mix[i]="e"){
sum[4]++;
}else if(mix[i]="f"){
sum[5]++;
}else if(mix[i]="g"){
sum[6]++;
}else if(mix[i]="h"){
sum[7]++;
}else if(mix[i]="i"){
sum[8]++;
}else if(mix[i]="j"){
sum[9]++;
}else if(mix[i]="k"){
sum[10]++;
}else if(mix[i]="l"){
sum[11]++;
}else if(mix[i]="m"){
sum[12]++;
}else if(mix[i]="n"){
sum[13]++;
}else if(mix[i]="o"){
sum[14]++;
}else if(mix[i]="p"){
sum[15]++;
}else if(mix[i]="q"){
sum[16]++;
}else if(mix[i]="r"){
sum[17]++;
}else if(mix[i]="s"){
sum[18]++;
}else if(mix[i]="t"){
sum[19]++;
}else if(mix[i]="u"){
sum[20]++;
}else if(mix[i]="v"){
sum[21]++;
}else if(mix[i]="w"){
sum[22]++;
}else if(mix[i]="x"){
sum[23]++;
}else if(mix[i]="y"){
sum[24]++;
}else if(mix[i]="z"){
sum[25]++;
}


}

for(int i=0;i<26;i++){
cout<<" "<<alpha[i]<<": "<<sum[i]<<endl;
}
}




Compiler output:
a.cc: In function 'int main()':
a.cc:26:11: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   26 | if(mix[i]="a"){
      |           ^~~
      |           |
      |           const char*
a.cc:28:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   28 | }else if(mix[i]="b"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:30:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   30 | }else if(mix[i]="c"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:32:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   32 | }else if(mix[i]="d"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:34:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   34 | }else if(mix[i]="e"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:36:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   36 | }else if(mix[i]="f"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:38:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   38 | }else if(mix[i]="g"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:40:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   40 | }else if(mix[i]="h"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:42:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   42 | }else if(mix[i]="i"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:44:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   44 | }else if(mix[i]="j"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:46:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   46 | }else if(mix[i]="k"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:48:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   48 | }else if(mix[i]="l"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:50:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   50 | }else if(mix[i]="m"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:52:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   52 | }else if(mix[i]="n"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:54:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   54 | }else if(mix[i]="o"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:56:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   56 | }else if(mix[i]="p"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:58:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   58 | }else if(mix[i]="q"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:60:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   60 | }else if(mix[i]="r"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:62:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   62 | }else if(mix[i]="s"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:64:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   64 | }else if(mix[i]="t"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:66:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   66 | }else if(mix[i]="u"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:68:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   68 | }else if(mix[i]="v"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:70:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   70 | }else if(mix[i]="w"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:72:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   72 | }else if(mix[i]="x"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:74:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   74 | }else if(mix[i]="y"){
      |                 ^~~
      |                 |
      |                 const char*
a.cc:76:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   76 | }else if(mix[i]="z"){
      |                 ^~~
      |                 |
      |                 const char*