13 int num[] = {1, 2, 3, 4, 5};
14 std::cout <<
"the average value of the integer values is " <<
accum(&num[0], &num[5]) / 5 <<
'\n';
17 char name[] =
"templates";
18 int length =
sizeof(name) - 1;
19 std::cout <<
"the average value of the characters in \"" << name <<
"\" is "
20 <<
accum(&name[0], &name[length]) / length <<
'\n';
T accum(T const *beg, T const *end)