|
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
template
<class TYPE1, class TYPE2, class TYPE3>
|
|
TYPE1
array_copy(TYPE2 dest[], TYPE3 source[], int size) {
|
for(int i=0; i < size; ++i)
|
|
dest[i] = source[i];
|
|
}
|
|
|
//client
program
|
|
char
a[100];
|
|
char
b[20];
|
|
cin.getline(b,
20, '\n');
|
|
|
//explicitly
specify type dependency for only first type
|
|
int
result;
|
|
result
= array_copy<int> (a,b,strlen(b));
|
|
|
|