traffic.cpp: In function 'int LocateCentre(int, int*, int*, int*)':
traffic.cpp:7:40: error: no matching function for call to 'accumulate(int*&, int*)'
const int sum = accumulate(p, p + n);
^
In file included from /usr/include/c++/7/numeric:62:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:84,
from traffic.cpp:1:
/usr/include/c++/7/bits/stl_numeric.h:120:5: note: candidate: template<class _InputIterator, class _Tp> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp)
accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
^~~~~~~~~~
/usr/include/c++/7/bits/stl_numeric.h:120:5: note: template argument deduction/substitution failed:
traffic.cpp:7:40: note: candidate expects 3 arguments, 2 provided
const int sum = accumulate(p, p + n);
^
In file included from /usr/include/c++/7/numeric:62:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:84,
from traffic.cpp:1:
/usr/include/c++/7/bits/stl_numeric.h:146:5: note: candidate: template<class _InputIterator, class _Tp, class _BinaryOperation> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation)
accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
^~~~~~~~~~
/usr/include/c++/7/bits/stl_numeric.h:146:5: note: template argument deduction/substitution failed:
traffic.cpp:7:40: note: candidate expects 4 arguments, 2 provided
const int sum = accumulate(p, p + n);
^