Language: C++

#include<iostream>
#include<cstdio>
#include<cctype>
using namespace std;
int main(){
    string a;
    int b[26]={};
    while(cin>>a){
        a=tolower(a);
        if(isalpha(a)){
            b[a-'a']++;
        }
    }
    for(int i=0;i<26;i++){
        cout<<a[i]<<" : "<<b[i]<<endl;
        
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: no matching function for call to 'tolower(std::string&)'
    9 |         a=tolower(a);
      |           ~~~~~~~^~~
In file included from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/locale_facets.h:2693:5: note: candidate: 'template<class _CharT> _CharT std::tolower(_CharT, const locale&)'
 2693 |     tolower(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2693:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/c++/14/cctype:42,
                 from /usr/include/c++/14/bits/localefwd.h:42,
                 from /usr/include/c++/14/ios:43:
/usr/include/ctype.h:122:12: note: candidate: 'int tolower(int)'
  122 | extern int tolower (int __c) __THROW;
      |            ^~~~~~~
/usr/include/ctype.h:122:25: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  122 | extern int tolower (int __c) __THROW;
      |                     ~~~~^~~
a.cc:10:19: error: no matching function for call to 'isalpha(std::string&)'
   10 |         if(isalpha(a)){
      |            ~~~~~~~^~~
/usr/include/c++/14/bits/locale_facets.h:2643:5: note: candidate: 'template<class _CharT> bool std::isalpha(_CharT, const locale&)'
 2643 |     isalpha(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2643:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/ctype.h:109:1: note: candidate: 'int isalpha(int)'
  109 | __exctype (isalpha);
      | ^~~~~~~~~
/usr/include/ctype.h:109:1: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  109 | __exctype (isalpha);
      | ^~~~~~~~~
a.cc:11:16: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
   11 |             b[a-'a']++;
      |               ~^~~~
      |               | |
      |               | char
      |               std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:11:17: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
   11 |             b[a-'a']++;
      |                 ^~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:11:17: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
   11 |             b[a-'a']++;
      |                 ^~~