/in/foo.cc: In function 'void getNext()':
/in/foo.cc:14:20: error: reference to 'next' is ambiguous
j = 0; k = -1; next[0] = -1;
^~~~
/in/foo.cc:7:5: note: candidates are: int next [10002]
int next[N];
^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc:17:13: error: reference to 'next' is ambiguous
next[++j] = ++k;
^~~~
/in/foo.cc:7:5: note: candidates are: int next [10002]
int next[N];
^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc:19:17: error: reference to 'next' is ambiguous
k = next[k];
^~~~
/in/foo.cc:7:5: note: candidates are: int next [10002]
int next[N];
^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc: In function 'int KMP_Index()':
/in/foo.cc:34:17: error: reference to 'next' is ambiguous
j = next[j];
^~~~
/in/foo.cc:7:5: note: candidates are: int next [10002]
int next[N];
^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:43:9: warning: unused variable 'i' [-Wunused-variable]
int i, cc;
^
/in/foo.cc:43:12: warning: unused variable 'cc' [-Wunused-variable]
int i, cc;
^~
/in/foo.cc: In function 'int KMP_Index()':
/in/foo.cc:38:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^