Language: C++

#include <iostream>
#include <cctype>
#include <string>

#define MAX_W_LEN (10)
#define MAX_T_LEN (1000)
#define MAX_T_SIZE

using namespace std;

int main()
{
    int      size;
    int      count = 0;
    string   W;
    string** T = new string*[MAX_T_SIZE];
   
    for (int i = 0; i < MAX_T_SIZE; i++) {
         T[i] = new string[MAX_T_LEN];
    }

    do {
        cin >> W;
    } while (W.length() > MAX_W_LEN);

    for (i = 0; i < MAX_T_SIZE; i++) {
         if (T[i][j] == "end_of_text") {
             size = i;
             break;
         } else {
             for (j = 0; j < MAX_T_LEN; j++) {
                  cin >> T[i][j];
 
                  if (T[i][j] == '\n') {                
                      break;
                  } else {
                      T[i][j] = all_lower(T[i][j]);
                  } 
             }
         }
    }

    for (int i = 0; i < size; i++) {
         for (j = 0; str[i][j] != '\n'; j++) {
              if (strcmp(T[i][j], W) == 0) {
                  count++;
              }
         }
    }

    cout << count << endl;

    delete[] W;
   
    for (int i = 0; i < MAX_T_SIZE; i++) {
         delete[] T[i];
    }

    free(T);

    return (0);
}

void all_lower(string str)
{  
     for (int i = 0; str[i] != '\0'; i++) {    
          if (str[i] >= 'A' && str[i] <= 'Z') {	   
 	      str[i] = tolower(str[i]);
	  } 
     }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:40: error: invalid use of array with unspecified bounds
   16 |     string** T = new string*[MAX_T_SIZE];
      |                                        ^
a.cc:18:35: error: expected primary-expression before ';' token
   18 |     for (int i = 0; i < MAX_T_SIZE; i++) {
      |                                   ^
a.cc:26:10: error: 'i' was not declared in this scope
   26 |     for (i = 0; i < MAX_T_SIZE; i++) {
      |          ^
a.cc:26:31: error: expected primary-expression before ';' token
   26 |     for (i = 0; i < MAX_T_SIZE; i++) {
      |                               ^
a.cc:27:19: error: 'j' was not declared in this scope
   27 |          if (T[i][j] == "end_of_text") {
      |                   ^
a.cc:37:33: error: 'all_lower' was not declared in this scope
   37 |                       T[i][j] = all_lower(T[i][j]);
      |                                 ^~~~~~~~~
a.cc:44:15: error: 'j' was not declared in this scope
   44 |          for (j = 0; str[i][j] != '\n'; j++) {
      |               ^
a.cc:44:22: error: 'str' was not declared in this scope; did you mean 'std'?
   44 |          for (j = 0; str[i][j] != '\n'; j++) {
      |                      ^~~
      |                      std
a.cc:45:19: error: 'strcmp' was not declared in this scope
   45 |               if (strcmp(T[i][j], W) == 0) {
      |                   ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cctype>
  +++ |+#include <cstring>
    3 | #include <string>
a.cc:53:14: error: type 'std::string' {aka 'class std::__cxx11::basic_string<char>'} argument given to 'delete', expected pointer
   53 |     delete[] W;
      |              ^
a.cc:55:35: error: expected primary-expression before ';' token
   55 |     for (int i = 0; i < MAX_T_SIZE; i++) {
      |                                   ^