Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;

int b[100], x1[100][100], Y1[100][100], x2[100][100], y2[100][100];
string link[100][100];
map<string, int>mp;
int main() {
	int n;
	while (scanf("%d", &n), n) {
		mp.clear();
		int w, h; scanf("%d%d", &w, &h);
		vector<string>v;
		rep(i, n) {
			string s; cin >> s >> b[i]; mp[s] = i;
			if (i == 0)v.push_back(s);
			rep(j, b[i])cin >> x1[i][j] >> Y1[i][j] >> x2[i][j] >> y2[i][j] >> link[i][j];
		}
		int pos = 0;
		int m; scanf("%d", &m);
		rep(i, m) {
			string s; cin >> s;
			if (s == "click") {
				int x, y; cin >> x >> y;
				int a = mp[pos];
				rep(i, b[a]) {
					if (x1[a][i] <= x&&x <= x2[a][i] && Y1[a][i] <= y&&y <= y2[a][i]) {
						v.erase(v.begin() + pos + 1, v.end());
						v.push_back(link[a][i]); pos = v.size() - 1; break;
					}
				}
			}
			if (s == "back") {
				if (pos)pos--;
			}
			if (s == "forward") {
				if (pos < v.size() - 1)pos++;
			}
			if (s == "show")cout << v[pos] << endl;
		}
	}
}

Compiler output:
a.cc:6:21: error: 'std::string link [100][100]' redeclared as different kind of entity
    6 | string link[100][100];
      |                     ^
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /usr/include/c++/14/csignal:42,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:116,
                 from a.cc:1:
/usr/include/unistd.h:819:12: note: previous declaration 'int link(const char*, const char*)'
  819 | extern int link (const char *__from, const char *__to)
      |            ^~~~
a.cc: In function 'int main()':
a.cc:17:98: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   17 |                         rep(j, b[i])cin >> x1[i][j] >> Y1[i][j] >> x2[i][j] >> y2[i][j] >> link[i][j];
      |                                                                                                  ^
a.cc:17:101: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   17 |                         rep(j, b[i])cin >> x1[i][j] >> Y1[i][j] >> x2[i][j] >> y2[i][j] >> link[i][j];
      |                                                                                                     ^
a.cc:17:89: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int(const char*, const char*) noexcept')
   17 |                         rep(j, b[i])cin >> x1[i][j] >> Y1[i][j] >> x2[i][j] >> y2[i][j] >> link[i][j];
      |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ ~~~~~~~~~~
      |                                                                             |                       |
      |                                                                             |                       int(const char*, const char*) noexcept
      |                                                                             std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  170 |       operator>>(bool& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:170:7: note:   conversion of argument 1 would be ill-formed:
a.cc:17:101: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int (*)(const char*, const char*) noexcept'
   17 |                         rep(j, b[i])cin >> x1[i][j] >> Y1[i][j] >> x2[i][j] >> y2[i][j] >> link[i][j];
      |                                                                                            ~~~~~~~~~^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
  174 |       operator>>(short& __n);
      |       ^~~~~~~~
/usr/include/c++/14/istream:174:7: note:   conversion of argument 1 would be ill-formed:
a.cc:17:101: error: invalid conversion from 'int (*)(const char*, const char*) noexcept' to 'short int' [-fpermissive]
   17 |                         rep(j, b[i])cin >> x1[i][j] >> Y1[i][j] >> x2[i][j] >> y2[i][j] >> link[i][j];
      |                                                                                            ~~~~~~~~~^
      |                                                                                                     |
      |                                                                                                     int (*)(const char*, const char*) noexcept
a.cc:17:101: error: cannot bind rvalue '(short int)(link + (((sizetype)i) + ((sizetype)j)))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  177 |       operator>>(unsigned short& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:177:7: note:   conversion of argument 1 would be ill-formed:
a.cc:17:101: error: invalid conversion from 'int (*)(const char*, const char*) noexcept' to 'short unsigned int' [-fpermissive]
   17 |                         rep(j, b[i])cin >> x1[i][j] >> Y1[i][j] >> x2[i][j] >> y2[i][j] >> link[i][j];
      |                                                                                            ~~~~~~~~~^
      |                                                                                                     |
      |                                                                                                     int (*)(const char*, const char*) noexcept
a.cc:17:101: error: cannot bind rvalue '(short unsigned int)(link + (((sizetype)i) + ((sizetype)j)))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
  181 |       operator>>(int& __n);
      |       ^~~~~~~~
/usr/include/c++/14/istream:181:7: note:   conversion of argument 1 would be ill-formed:
a.cc:17:101: error: invalid conversion from 'int (*)(const char*, const char*) noexcept' to 'int' [-fpermissive]
   17 |                         rep(j, b[i])cin >> x1[i][j] >> Y1[i][j] >> x2[i][j] >> y2[i][j] >> link[i][j];
      |                                                                                            ~~~~~~~~~^
      |                                                                                                     |
      |                                                                                                     int (*)(const char*, const char*) noexcept
a.cc:17:101: error: cannot bind rvalue '(int)(link + (((sizetype)i) + ((sizetype)j)))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  184 |       operator>>(unsigned int& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:184:7: note:   conversion of argument 1 would be ill-formed:
a.cc:17:101: error: invalid conversion from 'int (*)(const char*, const char*) noexcept' to 'unsigned int' [-fpermissive]
   17 |                         rep(j, b[i])cin >> x1[i][j] >> Y1[i][j] >> x2[i][j] >> y2[i][j] >> link[i][j];
      |                                                                                            ~~~~~~~~~^
      |                                                                                                     |
      |                                                                                                     int (*)(const char*, const char*) noexcept
a.cc:17:101: error: cannot bind rvalue '(unsigned int)(link + (((sizetype)i) + ((sizetype)j)))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  188 |       operator>>(long& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:188:7: note:   conversion of argument 1 would be ill-formed:
a.cc:17:101: error: invalid conversion from 'int (*)(const char*, const char*) noexcept' to 'long int' [-fpermissive]
   17 |                         rep(j, b[i])cin >> x1[i][j] >> Y1[i][j] >> x2[i][j] >> y2[i][j] >> link[i][j];
      |                                                                                            ~~~~~~~~~^
      |                                                                                                     |
      |                                                                                                     int (*)(const char*, const char*) noexcept
a.cc:17:101: error: cannot bind rvalue '(long int)(link + (((sizetype)i) + ((sizetype)j)))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  192 |       operator>>(unsigned long& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:192:7: note:   conversion of argument 1 would be ill-formed:
a.cc:17:101: error: invalid conversion from 'int (*)(const char*, const char*) noexcept' to 'long unsigned int' [-fpermissive]
   17 |                         rep(j, b[i])cin >> x1[i][j] >> Y1[i][j] >> x2[i][j] >> y2[i][j] >> link[i][j];
      |                                                                                            ~~~~~~~~~^
      |                                                                                                     |
      |                                                                                                     int (*)(const char*, const char*) noexcept
a.cc:17:101: error: cannot bind rvalue '(long unsigned int)(link + (((sizetype)i) + ((sizetype)j)))' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  199 |       operator>>(long long& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:19