ntemplate <class
TYPE1, class TYPE2> //function template
nvoid array_copy(TYPE1
dest[], TYPE2 source[], int size) {
n for(int i=0; i < size; ++i)
n dest[i] = source[i];
n}
ntemplate<> void
array_copy(char* dest[], char* source[], int size) {
n for(int i=0; i < size; ++i) {
n dest[i] = new char[strlen(source[i]) +
1];
n strcpy(dest[i], source[i]);
n }
n}
n//This specialized
function is called when:
nchar saying1[] =
"Hello World";
nchar saying2[] =
"This is a great day!";
nchar* s1[2] =
{saying1, saying2};
nchar* s2[2];
narray_copy(s2, s1,
2);
n