prog.cpp:5:13: error: array bound is not an integer constant before ‘]’ token
int arr[2][n] = {0};
^
prog.cpp:6:14: error: array bound is not an integer constant before ‘]’ token
int visited[n] = {0};
^
prog.cpp: In function ‘void calculate(int)’:
prog.cpp:13:17: error: reference to ‘max’ is ambiguous
if(minc>max)
^~~
prog.cpp:7:5: note: candidates are: int max
int max = -1;
^~~
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/c++/6/bits/stl_algobase.h:265:5: note: template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/6/bits/stl_algobase.h:219:5: note: template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)
max(const _Tp& __a, const _Tp& __b)
^~~
prog.cpp:15:13: error: reference to ‘max’ is ambiguous
max = minc;
^~~
prog.cpp:7:5: note: candidates are: int max
int max = -1;
^~~
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/c++/6/bits/stl_algobase.h:265:5: note: template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/6/bits/stl_algobase.h:219:5: note: template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)
max(const _Tp& __a, const _Tp& __b)
^~~
prog.cpp:18:28: error: ‘arr’ was not declared in this scope
int temp1 = minc + arr[0][pos];
^~~
prog.cpp:22:5: error: expected primary-expression before ‘}’ token
}
^
prog.cpp: In function ‘void get_pos(int, int)’:
prog.cpp:29:19: error: ‘permute_arr’ was not declared in this scope
int pos = permute_arr[i];
^~~~~~~~~~~
prog.cpp: In function ‘void get_permute(int)’:
prog.cpp:41:12: error: ‘visisted’ was not declared in this scope
if(visisted[i] == 0)
^~~~~~~~
prog.cpp:43:13: error: ‘visited’ was not declared in this scope
visited[i] = 1;
^~~~~~~
prog.cpp:44:13: error: ‘permute_arr’ was not declared in this scope
permute_arr[cnt] = i;
^~~~~~~~~~~
prog.cpp: In function ‘int main()’:
prog.cpp:57:18: error: ‘arr’ was not declared in this scope
cin>>arr[i][j];
^~~
prog.cpp:61:11: error: reference to ‘max’ is ambiguous
cout<<max;
^~~
prog.cpp:7:5: note: candidates are: int max
int max = -1;
^~~
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/c++/6/bits/stl_algobase.h:265:5: note: template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/6/bits/stl_algobase.h:219:5: note: template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)
max(const _Tp& __a, const _Tp& __b)
^~~