Neither is what I would do in C++
I would use one of those constructs:
#include <array>
void function(int values[10])
{
}
template<std::size_t N>
void function_template(int(&values)[N])
{
}
template<std::size_t N>
void function_const_ref(const std::array<int, N>& arr) // pass by const reference if you only want to use values
{
}
template<std::size_t N>
void function_ref(std::array<int, N>& arr)
{
arr[1] = 42;
}
int main()
{
int arr[10]{}; // {} also initializes all values to 0!
function(arr);
function_template(arr); // keeps working even if you change size from 10 to something else
// or use std::array and you ca
std::array<int, 10> arr2{};
function_ref(arr2);
// this is I think the most C++ way
function_const_ref(arr2);
return 0;
}