Sorry for the confusion. I will add it properly this time .

This is my hdr file (hdr.h) file.
Code:
class TFunctor
   {
   public:

      // two possible functions to call member function. virtual cause derived
      // classes will use a pointer to an object and a pointer to a member function
      // to make the function call
      virtual void operator()(const char* string)=0;  // call using operator
      virtual void Call(const char* string)=0;        // call using function
   };


   // derived template class
   template <class TClass> class TSpecificFunctor : public TFunctor
   {
   private:
      void (TClass::*fpt)(const char*);   // pointer to member function
      TClass* pt2Object;                  // pointer to object

   public:

      // constructor - takes pointer to an object and pointer to a member and stores
      // them in two private variables
      TSpecificFunctor(TClass* _pt2Object, void(TClass::*_fpt)(const char*))
         { pt2Object = _pt2Object;  fpt=_fpt; };

      // override operator "()"
      virtual void operator()(const char* string)
       { (*pt2Object.*fpt)(string);};              // execute member function

      // override function "Call"
      virtual void Call(const char* string)
        { (*pt2Object.*fpt)(string);};             // execute member function
   };
This is my CPP file
[code]

Code:
#include "hdr.h"
#include <iostream>
using namespace std;

class TClassA{
   public:

      TClassA(){};
      void Display(const char* text) { cout << text << endl; };

      /* more of TClassA */
   };

   // dummy class B
   class TClassB{
   public:

      TClassB(){};
      void Display(const char* text) { cout << text << endl; };

      /* more of TClassB */
   };

class test
     27    {
     28       public:
     29 
     30       // 1. instantiate objects of TClassA and TClassB
     31       TClassA objA;
     32       TClassB objB;
     33 
     34 
     35       TSpecificFunctor<TClassA> specFuncA(&objA, &TClassA::Display);
};


I get this error while compiling
Code:
[root@localhost example]# g++ -c hdr.cpp 
hdr.cpp:35: error: expected identifier before ‘&’ token
hdr.cpp:35: error: expected identifier before ‘&’ token
hdr.cpp:35: error: expected ‘,’ or ‘...’
[root@localhost example]#