If by "pointers to an array" you really meant literally pointers to an array, i.e. entities like T (*)[N] , then the overload might look like this
template < class E, size_t N > void show(E (*cont)[N], size_t n = 25, const char* del = " ") { size_t i = 1; for (auto val : *cont) { std::cout << val << del; if (!(i % n)) std::cout <<'\n'; ++i; } }
However, there is no point in this, because your existing implementation already knows how to work with arrays and you don’t need any overloads for "array pointers" here.
I suspect that you need an overload for ordinary pointers to an array element . Such an overload cannot be made completely analogous to the existing one, because it is impossible to determine its size by the pointer to the array element. Therefore, in this case, the size will have to be transferred manually, as a separate parameter
template < class E > void show(const E cont[], size_t N, size_t n = 25, const char* del = " ") { for (size_t i = 0; i < N; ++i) { auto val = cont[i]; std::cout << val << del; if (!((i + 1) % n)) std::cout <<'\n'; } }