Language: C++

#include <iostream>
#include <string>
#include <cstring>
using namespace std;

int main(void) {
    string str;
    string order;
    int a, b;
    
    getline(cin, str);
    
    while(cin >> order) {
        if(strstr(order, "print")) {
            cin >> a >> b;
            for(int i = 0; i < b - a + 1; ++i) {
                cout << str[a + i];
            }
            cout << endl;
        } else if(strstr(order, "reverse")) {
            cin >> a >> b;
            char copy[1000];
            for(int i = 0; i < b - a + 1; ++i) {
                copy[b - a - i] = str[i];
                str.replace(a, b, copy);
            }
        } else if(strstr(order, "replace")) {
            char word[100];
            cin >> a >> b >> word;
            str.replace(a, b, word);
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: no matching function for call to 'strstr(std::string&, const char [6])'
   14 |         if(strstr(order, "print")) {
      |            ~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cstring:43,
                 from a.cc:3:
/usr/include/string.h:330:14: note: candidate: 'char* strstr(char*, const char*)'
  330 | extern char *strstr (char *__haystack, const char *__needle)
      |              ^~~~~~
/usr/include/string.h:330:28: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char*'
  330 | extern char *strstr (char *__haystack, const char *__needle)
      |                      ~~~~~~^~~~~~~~~~
/usr/include/string.h:332:20: note: candidate: 'const char* strstr(const char*, const char*)'
  332 | extern const char *strstr (const char *__haystack, const char *__needle)
      |                    ^~~~~~
/usr/include/string.h:332:40: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
  332 | extern const char *strstr (const char *__haystack, const char *__needle)
      |                            ~~~~~~~~~~~~^~~~~~~~~~
a.cc:20:25: error: no matching function for call to 'strstr(std::string&, const char [8])'
   20 |         } else if(strstr(order, "reverse")) {
      |                   ~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/string.h:330:14: note: candidate: 'char* strstr(char*, const char*)'
  330 | extern char *strstr (char *__haystack, const char *__needle)
      |              ^~~~~~
/usr/include/string.h:330:28: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char*'
  330 | extern char *strstr (char *__haystack, const char *__needle)
      |                      ~~~~~~^~~~~~~~~~
/usr/include/string.h:332:20: note: candidate: 'const char* strstr(const char*, const char*)'
  332 | extern const char *strstr (const char *__haystack, const char *__needle)
      |                    ^~~~~~
/usr/include/string.h:332:40: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
  332 | extern const char *strstr (const char *__haystack, const char *__needle)
      |                            ~~~~~~~~~~~~^~~~~~~~~~
a.cc:27:25: error: no matching function for call to 'strstr(std::string&, const char [8])'
   27 |         } else if(strstr(order, "replace")) {
      |                   ~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/string.h:330:14: note: candidate: 'char* strstr(char*, const char*)'
  330 | extern char *strstr (char *__haystack, const char *__needle)
      |              ^~~~~~
/usr/include/string.h:330:28: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char*'
  330 | extern char *strstr (char *__haystack, const char *__needle)
      |                      ~~~~~~^~~~~~~~~~
/usr/include/string.h:332:20: note: candidate: 'const char* strstr(const char*, const char*)'
  332 | extern const char *strstr (const char *__haystack, const char *__needle)
      |                    ^~~~~~
/usr/include/string.h:332:40: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
  332 | extern const char *strstr (const char *__haystack, const char *__needle)
      |                            ~~~~~~~~~~~~^~~~~~~~~~