Language: C++

#include<bits/stdc++.h>
#include<string.h>
using namespace std;
int main()
{ string a,b,s,d;
  gets(a);
 strcpy(b, a);strrev(b);
 if (strcmp(a, b) == 0) 
 {
   for(int i=0;i<strlen(a)/2;i++)
   {
     if(i<=strlen(a)/2) s[i]=a[i];
       else d[i]=a[i];
   }
   strcpy(a,s);
   strcpy(b,d);
   strrev(s);strrev(d);
   if(strcmp(a,b)==0)
   {cout<<"yes";}
   else cout<<"no";
 }
  else
    printf("The string isn't a palindrome.\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |   gets(a);
      |   ^~~~
      |   getw
a.cc:7:9: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char*'
    7 |  strcpy(b, a);strrev(b);
      |         ^
      |         |
      |         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:141:39: note:   initializing argument 1 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
a.cc:7:15: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
    7 |  strcpy(b, a);strrev(b);
      |               ^~~~~~
      |               strsep
a.cc:8:13: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
    8 |  if (strcmp(a, b) == 0)
      |             ^
      |             |
      |             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:10:25: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   10 |    for(int i=0;i<strlen(a)/2;i++)
      |                         ^
      |                         |
      |                         std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:12:19: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   12 |      if(i<=strlen(a)/2) s[i]=a[i];
      |                   ^
      |                   |
      |                   std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:15:11: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char*'
   15 |    strcpy(a,s);
      |           ^
      |           |
      |           std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:141:39: note:   initializing argument 1 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
a.cc:16:11: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char*'
   16 |    strcpy(b,d);
      |           ^
      |           |
      |           std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:141:39: note:   initializing argument 1 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
a.cc:18:14: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   18 |    if(strcmp(a,b)==0)
      |              ^
      |              |
      |              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)
      |                    ~~~~~~~~~~~~^~~~