Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
string in;
string alpha="abcdefghijklmnopqrstuvwxyz";
char 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:7:10: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
    7 | char mix="";
      |          ^~
      |          |
      |          const char*
a.cc:18:8: error: cannot convert 'std::__cxx11::basic_string<char>' to 'char' in assignment
   18 | mix=mix+in;
      |     ~~~^~~
      |        |
      |        std::__cxx11::basic_string<char>
a.cc:22:7: error: request for member 'length' in 'mix', which is of non-class type 'char'
   22 | a=mix.length();
      |       ^~~~~~
a.cc:26:7: error: invalid types 'char[int]' for array subscript
   26 | if(mix[i]="a"){
      |       ^
a.cc:28:13: error: invalid types 'char[int]' for array subscript
   28 | }else if(mix[i]="b"){
      |             ^
a.cc:30:13: error: invalid types 'char[int]' for array subscript
   30 | }else if(mix[i]="c"){
      |             ^
a.cc:32:13: error: invalid types 'char[int]' for array subscript
   32 | }else if(mix[i]="d"){
      |             ^
a.cc:34:13: error: invalid types 'char[int]' for array subscript
   34 | }else if(mix[i]="e"){
      |             ^
a.cc:36:13: error: invalid types 'char[int]' for array subscript
   36 | }else if(mix[i]="f"){
      |             ^
a.cc:38:13: error: invalid types 'char[int]' for array subscript
   38 | }else if(mix[i]="g"){
      |             ^
a.cc:40:13: error: invalid types 'char[int]' for array subscript
   40 | }else if(mix[i]="h"){
      |             ^
a.cc:42:13: error: invalid types 'char[int]' for array subscript
   42 | }else if(mix[i]="i"){
      |             ^
a.cc:44:13: error: invalid types 'char[int]' for array subscript
   44 | }else if(mix[i]="j"){
      |             ^
a.cc:46:13: error: invalid types 'char[int]' for array subscript
   46 | }else if(mix[i]="k"){
      |             ^
a.cc:48:13: error: invalid types 'char[int]' for array subscript
   48 | }else if(mix[i]="l"){
      |             ^
a.cc:50:13: error: invalid types 'char[int]' for array subscript
   50 | }else if(mix[i]="m"){
      |             ^
a.cc:52:13: error: invalid types 'char[int]' for array subscript
   52 | }else if(mix[i]="n"){
      |             ^
a.cc:54:13: error: invalid types 'char[int]' for array subscript
   54 | }else if(mix[i]="o"){
      |             ^
a.cc:56:13: error: invalid types 'char[int]' for array subscript
   56 | }else if(mix[i]="p"){
      |             ^
a.cc:58:13: error: invalid types 'char[int]' for array subscript
   58 | }else if(mix[i]="q"){
      |             ^
a.cc:60:13: error: invalid types 'char[int]' for array subscript
   60 | }else if(mix[i]="r"){
      |             ^
a.cc:62:13: error: invalid types 'char[int]' for array subscript
   62 | }else if(mix[i]="s"){
      |             ^
a.cc:64:13: error: invalid types 'char[int]' for array subscript
   64 | }else if(mix[i]="t"){
      |             ^
a.cc:66:13: error: invalid types 'char[int]' for array subscript
   66 | }else if(mix[i]="u"){
      |             ^
a.cc:68:13: error: invalid types 'char[int]' for array subscript
   68 | }else if(mix[i]="v"){
      |             ^
a.cc:70:13: error: invalid types 'char[int]' for array subscript
   70 | }else if(mix[i]="w"){
      |             ^
a.cc:72:13: error: invalid types 'char[int]' for array subscript
   72 | }else if(mix[i]="x"){
      |             ^
a.cc:74:13: error: invalid types 'char[int]' for array subscript
   74 | }else if(mix[i]="y"){
      |             ^
a.cc:76:13: error: invalid types 'char[int]' for array subscript
   76 | }else if(mix[i]="z"){
      |             ^