foo.cc:9:5: error: 'int index' redeclared as different kind of entity
9 | int index = -1;
| ^~~~~
In file included from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/string.h:462,
from /nix/store/r0n0bpr0s38f02hyg0akd63yxc1d2n86-gcc/include/c++/12.3.0/cstring:42,
from foo.cc:3:
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/strings.h:61:1: note: previous declaration 'const char* index(const char*, int)'
61 | index (const char *__s, int __c) __THROW
| ^~~~~
foo.cc: In function 'void row()':
foo.cc:25:35: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator=='
25 | if (index == -1) {
| ~~~~~~^~~~~
foo.cc:26:41: error: overloaded function with no contextual type information
26 | index = i;
| ^
foo.cc: In function 'void queue()':
foo.cc:48:35: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator=='
48 | if (index == -1) {
| ~~~~~~^~~~~
foo.cc:49:41: error: overloaded function with no contextual type information
49 | index = i;
| ^
foo.cc: In function 'int main()':
foo.cc:68:19: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator!='
68 | if (index != -1) {
| ~~~~~~^~~~~
foo.cc:78:19: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator!='
78 | if (index != -1) {
| ~~~~~~^~~~~
[Hydro](https://hydro.ac)提供评测服务