One way to write the function in modern C++ would be:
void PrintArray(const std::array<int, 4>& arr) { for (const auto elem : arr) { std::cout << elem << std::endl; } }