#include <iostream> using namespace std; template <typename T, size_t N> void print(const T (& r)[N]) { for (size_t i = 0; i < N; ++i) { cout << r[i] << endl; } } int main() { const int c[] = { 1, 2, 4, 8 }; print(c); const double d[] = { 3.14159, 2.71828, .57722 }; print(d); }