#include // string #include // EXIT_SUCCESS // Return a pointer to a new N-element heap array filled with val // (not entirely realistic, but shows what's possible) template T* valarray(const T& val) { T* a = new T[N]; for (int i = 0; i < N; ++i) a[i] = val; return a; } int main(int argc, char** argv) { int* ip = valarray(17); std::string* sp = valarray("hello"); delete[] ip; delete[] sp; return EXIT_SUCCESS; }