Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
accum10.cpp
Go to the documentation of this file.
1 
7 #include "accum10.hpp"
8 #include <iostream>
9 
10 int main()
11 {
12  // create array of 5 integer values and print average value
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';
15 
16  // create array of character values and (try to) print average character value
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';
21 
22  return 0;
23 }
int main()
Definition: accum10.cpp:10
T accum(T const *beg, T const *end)
Definition: accum1.hpp:9