template <typename T, std::size_t size>
void printArray(const std::array<T, size>& myArray)
{
for (auto element : myArray)
std::cout << element << ' ';
std::cout << '\n';
}
Why is std::size_t
being used? What are the benefits of size_t
vs unsigned int
?