foo.cc: In function ‘int main()’:
foo.cc:24:43: error: expected ‘)’ before ‘,2’
24 | ans=sqrt(pow((dist[n-1].x - dist[0].x),2.0)+pow((dist[n-1].y - dist[0].y), 2.0));
| ~ ^~~
| )
foo.cc:24:17: error: no matching function for call to ‘pow(double)’
24 | ans=sqrt(pow((dist[n-1].x - dist[0].x),2.0)+pow((dist[n-1].y - dist[0].y), 2.0));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /nix/gcc-14-20241116/include/c++/14-20241116/valarray:605,
from stdc++.h:166:
/nix/gcc-14-20241116/include/c++/14-20241116/bits/valarray_after.h:549:1: note: candidate: ‘template<class _Tp> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_Constant, std::_ValArray, _Tp, _Tp>, _Tp> std::pow(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)’
549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-14-20241116/include/c++/14-20241116/bits/valarray_after.h:549:1: note: candidate expects 2 arguments, 1 provided
/nix/gcc-14-20241116/include/c++/14-20241116/bits/valarray_after.h:549:1: note: candidate: ‘template<class _Tp> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_ValArray, std::_Constant, _Tp, _Tp>, _Tp> std::pow(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)’
549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-14-20241116/include/c++/14-20241116/bits/valarray_after.h:549:1: note: candidate expects 2 arguments, 1 provided
/nix/gcc-14-20241116/include/c++/14-20241116/bits/valarray_after.h:549:1: note: candidate: ‘template<class _Tp> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_ValArray, std::_ValArray, _Tp, _Tp>, _Tp> std::pow(const valarray<_Tp>&, const valarray<_Tp>&)’
549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-14-20241116/include/c++/14-20241116/bits/valarray_after.h:549:1: note: candidate expects 2 arguments, 1 provided
/nix/gcc-14-20241116/include/c++/14-20241116/bits/valarray_after.h:549:1: note: candidate: ‘template<class _Dom> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename _Dom::value_type> std::pow(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)’
549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-14-20241116/include/c++/14-20241116/bits/valarray_after.h:549:1: note: candidate expects 2 arguments, 1 provided
/nix/gcc-14-20241116/include/c++/14-20241116/bits/valarray_after.h:549:1: note: candidate: ‘template<class _Dom> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename _Dom::value_type> std::pow(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)’
549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-14-20241116/include/c++/14-20241116/bits/valarray_after.h:549:1: note: candidate expects 2 arguments, 1 provided
/nix/gcc-14-20241116/include/c++/14-20241116/bits/valarray_after.h:549:1: note: candidate: ‘template<class _Dom> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename _Dom::value_type> std::pow(const valarray<typename _Dom::valarray>&, const _Expr<_Dom1, typename _Dom1::value_type>&)’
549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-14-20241116/include/c++/14-20241116/bits/valarray_after.h:549:1: note: candidate expects 2 arguments, 1 provided
/nix/gcc-14-20241116/include/c++/14-20241116/bits/valarray_after.h:549:1: note: candidate: ‘template<class _Dom> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename _Dom::value_type> std::pow(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)’
549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-14-20241116/include/c++/14-20241116/bits/valarray_after.h:549:1: note: candidate expects 2 arguments, 1 provided
/nix/gcc-14-20241116/include/c++/14-20241116/bits/valarray_after.h:549:1: note: candidate: ‘template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename _Dom1::value_type> std::pow(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)’
549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-14-20241116/include/c++/14-20241116/bits/valarray_after.h:549:1: note: candidate expects 2 arguments, 1 provided
In file included from /nix/gcc-14-20241116/include/c++/14-20241116/ccomplex:39,
from stdc++.h:127:
/nix/gcc-14-20241116/include/c++/14-20241116/complex:2482:5: note: candidate: ‘template<class _Tp, class _Up> std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type> std::pow(const complex<_Tp>&, const complex<_Up>&)’
2482 | pow(const std::complex<_Tp>& __x, const std::complex<_Up>& __y)
| ^~~
/nix/gcc-14-20241116/include/c++/14-20241116/complex:2482:5: note: candidate expects 2 arguments, 1 provided
/nix/gcc-14-20241116/include/c++/14-20241116/complex:2474:5: note: candidate: ‘template<class _Tp, class _Up> std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type> std::pow(const _Tp&, const complex<_Up>&)’
2474 | pow(const _Tp& __x, const std::complex<_Up>& __y)
| ^~~
/nix/gcc-14-20241116/include/c++/14-20241116/complex:2474:5: note: candidate expects 2 arguments, 1 provided
/nix/gcc-14-20241116/include/c++/14-20241116/complex:2466:5: note: candidate: ‘template<class _Tp, class _Up> std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type> std::pow(const complex<_Tp>&, const _Up&)’
2466 | pow(const std::complex<_Tp>& __x, const _Up& __y)
| ^~~
/nix/gcc-14-20241116/include/c++/14-20241116/complex:2466:5: note: candidate expects 2 arguments, 1 provided
/nix/gcc-14-20241116/include/c++/14-20241116/complex:1339:5: note: candidate: ‘template<class _Tp> std::complex<_Tp> std::pow(const _Tp&, const complex<_Tp>&)’
1339 | pow(const _Tp& __x, const complex<_Tp>& __y)
| ^~~
/nix/gcc-14-20241116/include/c++/14-20241116/complex:1339:5: note: candidate expects 2 arguments, 1 provided
/nix/gcc-14-20241116/include/c++/14-20241116/complex:1328:5: note: candidate: ‘template<class _Tp> std::complex<_Tp> std::pow(const complex<_Tp>&, const complex<_Tp>&)’
1328 | pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~
/nix/gcc-14-20241116/include/c++/14-20241116/complex:1328:5: note: candidate expects 2 arguments, 1 provided
/nix/gcc-14-20241116/include/c++/14-20241116/complex:1294:5: note: candidate: ‘template<class _Tp> std::complex<_Tp> std::pow(const complex<_Tp>&, const _Tp&)’
1294 | pow(const complex<_Tp>& __x, const _Tp& __y)
| ^~~
/nix/gcc-14-20241116/include/c++/14-20241116/complex:1294:5: note: candidate expects 2 arguments, 1 provided
/nix/gcc-14-20241116/include/c++/14-20241116/complex:1285:5: note: candidate: ‘template<class _Tp> std::complex<_Tp> std::pow(const complex<_Tp>&, int)’
1285 | pow(const complex<_Tp>& __z, int __n)
| ^~~
/nix/gcc-14-20241116/include/c++/14-20241116/complex:1285:5: note: candidate expects 2 arguments, 1 provided
In file included from stdc++.h:114:
/nix/gcc-14-20241116/include/c++/14-20241116/cmath:1074:5: note: candidate: ‘template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up)’
1074 | pow(_Tp __x, _Up __y)
| ^~~
/nix/gcc-14-20241116/include/c++/14-20241116/cmath:1074:5: note: candidate expects 2 arguments, 1 provided
In file included from /nix/glibc-2.40-66-dev/include/features.h:511,
from /nix/gcc-14-20241116/include/c++/14-20241116/x86_64-unknown-linux-gnu/bits/os_defines.h:39,
from /nix/gcc-14-20241116/include/c++/14-20241116/x86_64-unknown-linux-gnu/bits/c++config.h:680,
from /nix/gcc-14-20241116/include/c++/14-20241116/cassert:43,
from stdc++.h:33:
/nix/glibc-2.40-66-dev/include/bits/mathcalls.h:155:1: note: candidate: ‘double pow(double, double)’
155 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
| ^~~~~~~~~~~~~~
/nix/glibc-2.40-66-dev/include/bits/mathcalls.h:155:1: note: candidate expects 2 arguments, 1 provided
/nix/gcc-14-20241116/include/c++/14-20241116/cmath:380:3: note: candidate: ‘constexpr long double std::pow(long double, long double)’
380 | pow(long double __x, long double __y)
| ^~~
/nix/gcc-14-20241116/include/c++/14-20241116/cmath:380:3: note: candidate expects 2 arguments, 1 provided
/nix/gcc-14-20241116/include/c++/14-20241116/cmath:376:3: note: candidate: ‘constexpr float std::pow(float, float)’
376 | pow(float __x, float __y)
| ^~~
/nix/gcc-14-20241116/include/c++/14-20241116/cmath:376:3: note: candidate expects 2 arguments, 1 provided
foo.cc:25:18: error: ‘i’ was not declared in this scope
25 | for (int i=0;i<n;i++)
| ^