Language: C++

#include<iostream>
#include<string>
using namespace std;
int main()
{
  //天気の入力
  string S;
  cin >> S;
  
  //天気の配列
  string weather[3];
  weather[3] = {"Sunny","Cloudy","Rainy"};
  
  //判定
  switch(S){
    case weather[0]:
      cout << weather[1];
      break;
    case weather[1]:
      cout << weather[2];
      break;
    case weather[2]:
      cout << weather[0];
      break;
  }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:41: error: no match for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and '<brace-enclosed initializer list>')
   12 |   weather[3] = {"Sunny","Cloudy","Rainy"};
      |                                         ^
In file included from /usr/include/c++/14/string:54,
                 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,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:926:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' (near match)
  926 |       operator=(initializer_list<_CharT> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:926:7: note:   conversion of argument 1 would be ill-formed:
a.cc:12:17: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   12 |   weather[3] = {"Sunny","Cloudy","Rainy"};
      |                 ^~~~~~~
      |                 |
      |                 const char*
a.cc:12:25: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   12 |   weather[3] = {"Sunny","Cloudy","Rainy"};
      |                         ^~~~~~~~
      |                         |
      |                         const char*
a.cc:12:34: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   12 |   weather[3] = {"Sunny","Cloudy","Rainy"};
      |                                  ^~~~~~~
      |                                  |
      |                                  const char*
/usr/include/c++/14/bits/basic_string.h:941:8: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  941 |        operator=(const _Tp& __svt)
      |        ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:941:8: note:   template argument deduction/substitution failed:
a.cc:12:41: note:   couldn't deduce template parameter '_Tp'
   12 |   weather[3] = {"Sunny","Cloudy","Rainy"};
      |                                         ^
/usr/include/c++/14/bits/basic_string.h:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  817 |       operator=(const basic_string& __str)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:817:37: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::__cxx11::basic_string<char>&'
  817 |       operator=(const basic_string& __str)
      |                 ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  828 |       operator=(const _CharT* __s)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:828:31: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const char*'
  828 |       operator=(const _CharT* __s)
      |                 ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  840 |       operator=(_CharT __c)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:840:24: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'char'
  840 |       operator=(_CharT __c)
      |                 ~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  858 |       operator=(basic_string&& __str)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:858:32: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::__cxx11::basic_string<char>&&'
  858 |       operator=(basic_string&& __str)
      |                 ~~~~~~~~~~~~~~~^~~~~
a.cc:15:10: error: switch quantity not an integer
   15 |   switch(S){
      |          ^
a.cc:16:10: error: the value of 'weather' is not usable in a constant expression
   16 |     case weather[0]:
      |          ^~~~~~~
a.cc:11:10: note: 'weather' was not declared 'constexpr'
   11 |   string weather[3];
      |          ^~~~~~~
a.cc:19:10: error: the value of 'weather' is not usable in a constant expression
   19 |     case weather[1]:
      |          ^~~~~~~
a.cc:11:10: note: 'weather' was not declared 'constexpr'
   11 |   string weather[3];
      |          ^~~~~~~
a.cc:22:10: error: the value of 'weather' is not usable in a constant expression
   22 |     case weather[2]:
      |          ^~~~~~~
a.cc:11:10: note: 'weather' was not declared 'constexpr'
   11 |   string weather[3];
      |          ^~~~~~~