| | | | | |

Function Objects -- 2

  • Declare a function object like any other class
  • Evaluate a function object by applying the operator () after the object name
  • class MakeUpperCase; // function class defined previously
    
    MakeUpperCase muc;   // declares object muc of type MakeUpperCase
                         // muc is a function object
    char ch;
    cin >> ch;
    muc(ch);             // makes ch upper case
    

| | Top of Page | 5. Function Classes & - 2 of 11