// This example (part of a series) illustrates how to to use a functor. // We build up slowly, starting with a plain old function. #include #include using namespace std; // Don’t roll your own--use std::toupper() instead. char embiggen(char c) { if ('a' <= c && c <= 'z') return c - 'a' + 'A'; else return c; } int main() { string name = "Beverly Hills Chihuahua"; for (unsigned i=0; i