/in/foo.cc:9:50: error: 'int index' redeclared as different kind of symbol
int stack[1001],heads[1001],visit[1001],cnt,tot,index,ans;
^~~~~
In file included from /in/foo.cc:3: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:20:14: error: no pre-increment operator for type
stack[++index]=x;//进站
^~~~~
/in/foo.cc:36:31: error: invalid types 'int [1001][<unresolved overloaded function type>]' for array subscript
visit[stack[index]]=0;
^
/in/foo.cc:37:19: error: no post-decrement operator for type
index--;
^~
/in/foo.cc:38:31: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
}while(x!=stack[index+1]);//出栈,并且输出。
~~~~~^~