/in/foo.cc:10:49: error: 'int index' redeclared as different kind of symbol
int stack[1001],heads[1001],visit[1001],cnt,tot,index;
^~~~~
In file included from /in/foo.cc:4:0:
/usr/include/string.h:477:1: note: previous declaration 'const char* index(const char*, int)'
index (const char *__s, int __c) __THROW
^~~~~
/in/foo.cc: In function 'void tarjan(int)':
/in/foo.cc:23:13: error: no pre-increment operator for type
stack[++index]=x;//进栈
^~~~~
/in/foo.cc:37:29: error: invalid types 'int [1001][<unresolved overloaded function type>]' for array subscript
int sign=stack[index];
^
/in/foo.cc:40:30: error: invalid types 'int [1001][<unresolved overloaded function type>]' for array subscript
visit[stack[index]]=0;
^
/in/foo.cc:41:29: error: invalid types 'int [1001][<unresolved overloaded function type>]' for array subscript
setn[stack[index]]=sign;
^
/in/foo.cc:42:18: error: no post-decrement operator for type
index--;
^~
/in/foo.cc:43:30: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
}while(x!=stack[index+1]);//出栈,并且输出。
~~~~~^~
/in/foo.cc: In function 'int main()':
/in/foo.cc:53:9: warning: unused variable 'x' [-Wunused-variable]
int x,y;
^
/in/foo.cc:53:11: warning: unused variable 'y' [-Wunused-variable]
int x,y;
^