foo.cpp: In function 'int main()':
foo.cpp:42:5: error: reference to 'next' is ambiguous
next[etot]=ptr[i],ptr[i]=etot,succ[etot++]=j;
^
foo.cpp:16:5: note: candidates are: int next [1000005]
int next[1000005],ptr[1005],succ[1000005];
^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
from foo.cpp:1:
c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_iterator_base_funcs.h:184:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^
foo.cpp:58:29: error: reference to 'next' is ambiguous
for(i=ptr[stack[top]];i;i=next[i]){
^
foo.cpp:16:5: note: candidates are: int next [1000005]
int next[1000005],ptr[1005],succ[1000005];
^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:66:0,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
from foo.cpp:1:
c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_iterator_base_funcs.h:184:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^