Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    string SUN,MON,TUE,WED,THU,FRI,SAT;
    string S;

    cin >>S;

    if(!strcmp(S,"SUN")){
        cout << "7" << endl;
    }else if(!strcmp(S,"MON")){
        cout << "6" << endl;
    }else if(!strcmp(S,"TUE")){
        cout << "5" << endl;
    }else if(!strcmp(S,"WED")){
        cout << "4" << endl;
    }else if(!strcmp(S,"THU")){
        cout << "3" << endl;
    }else if(!strcmp(S,"FRI")){
        cout << "2" << endl;
    }else {
        cout << "1" << endl; 
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   10 |     if(!strcmp(S,"SUN")){
      |                ^
      |                |
      |                std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:12:22: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   12 |     }else if(!strcmp(S,"MON")){
      |                      ^
      |                      |
      |                      std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:14:22: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   14 |     }else if(!strcmp(S,"TUE")){
      |                      ^
      |                      |
      |                      std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:16:22: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   16 |     }else if(!strcmp(S,"WED")){
      |                      ^
      |                      |
      |                      std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:18:22: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   18 |     }else if(!strcmp(S,"THU")){
      |                      ^
      |                      |
      |                      std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:20:22: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   20 |     }else if(!strcmp(S,"FRI")){
      |                      ^
      |                      |
      |                      std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~