Language: C++

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

const int size = 3;

bool check ( char hyo[size][size], char mark )
{
  for (int y = 0; y < size; ++y)
    for (int x = 0; x < size; ++x)
    {
       if (x+2 < size && hyo[y][x] == mark && hyo[y][x+1] == mark && hyo[y][x+2] == mark) { return true; }
       if (y+2 < size && hyo[y][x] == mark && hyo[y+1][x] == mark && hyo[y+2][x] == mark) { return true; }
       if (x+2 < size && y+2 < size && hyo[y][x] == mark && hyo[y+1][x+1] == mark && hyo[y+2][x+2] == mark) { return true; }
       if (x-2 >= 0 && y+2 < size && hyo[y][x] == mark && hyo[y+1][x-1] == mark && hyo[y+2][x-2] == mark) { return true; }
    }
    return false;
}

int main ( void )
{
  string str;
  while (cin >> str)
  {
     char hyo[size][size];

     for (int y = 0; y < size; ++y)
       for (int x = 0; x < size; ++x)
         hyo[y][x] = str[y*size + x];

     char judge = 'd'
     char mark[] = { 'o', 'x' };

     for (int i = 0; i < 2; ++i)
     {
        if (check(hyo, mark[i])) { judge = mark[i]; }
     }

     cout << judge << endl;
  }
  return 0;
}

Compiler output:
a.cc:9:23: error: reference to 'size' is ambiguous
    9 | bool check ( char hyo[size][size], char mark )
      |                       ^~~~
In file included from /usr/include/c++/14/string:53,
                 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/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:7:11: note:                 'const int size'
    7 | const int size = 3;
      |           ^~~~
a.cc:9:29: error: reference to 'size' is ambiguous
    9 | bool check ( char hyo[size][size], char mark )
      |                             ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:7:11: note:                 'const int size'
    7 | const int size = 3;
      |           ^~~~
a.cc:9:34: error: expected ')' before ',' token
    9 | bool check ( char hyo[size][size], char mark )
      |            ~                     ^
      |                                  )
a.cc:9:36: error: expected unqualified-id before 'char'
    9 | bool check ( char hyo[size][size], char mark )
      |                                    ^~~~
a.cc: In function 'int main()':
a.cc:27:15: error: reference to 'size' is ambiguous
   27 |      char hyo[size][size];
      |               ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:7:11: note:                 'const int size'
    7 | const int size = 3;
      |           ^~~~
a.cc:27:21: error: reference to 'size' is ambiguous
   27 |      char hyo[size][size];
      |                     ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:7:11: note:                 'const int size'
    7 | const int size = 3;
      |           ^~~~
a.cc:29:26: error: reference to 'size' is ambiguous
   29 |      for (int y = 0; y < size; ++y)
      |                          ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:7:11: note:                 'const int size'
    7 | const int size = 3;
      |           ^~~~
a.cc:30:28: error: reference to 'size' is ambiguous
   30 |        for (int x = 0; x < size; ++x)
      |                            ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:7:11: note:                 'const int size'
    7 | const int size = 3;
      |           ^~~~
a.cc:31:10: error: 'hyo' was not declared in this scope
   31 |          hyo[y][x] = str[y*size + x];
      |          ^~~
a.cc:31:28: error: reference to 'size' is ambiguous
   31 |          hyo[y][x] = str[y*size + x];
      |                            ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:7:11: note:                 'const int size'
    7 | const int size = 3;
      |           ^~~~
a.cc:34:6: error: expected ',' or ';' before 'char'
   34 |      char mark[] = { 'o', 'x' };
      |      ^~~~
a.cc:38:19: error: 'hyo' was not declared in this scope
   38 |         if (check(hyo, mark[i])) { judge = mark[i]; }
      |                   ^~~
a.cc:38:24: error: 'mark' was not declared in this scope
   38 |         if (check(hyo, mark[i])) { judge = mark[i]; }
      |                        ^~~~