Q:

How to set values for structure members in Base class that remain the same in the Derived class

With reference to the following code:
class Base
{   
public:
struct DataType
{
    public:
      long double var1;
      int begin;
      int stop;

      inline DataType() {}
      inline long double get_var1() {return this->var1;}    
      inline int get_begin() {return this->begin;}  
      inline int get_stop() {return this->stop;}

      inline void set_var1(long double var1) {this->var1=var1;} 
      inline void set_begin(int begin) {this->begin=begin;} 
      inline void set_stop(int stop) {this->stop=stop;}
};

inline Base() {}
virtual ~Base() {}  

protected:
virtual void funct()
{

}

void execute()
{
   // How can I set a value of begin here?
   funct(); 
   // How can I set a value of stop here?   
}
};

class Derived:public Base
{
    DataType dt;

    public:
    inline Derived() 
    {
    this->dt.set_var1(0.005);       
    }   
    inline ~Derived() {}

    protected:
    void funct();
};

void Derived::funct()
{
    //Some implementation
}    

Apart from this, there is a lot more code and somewhere Derived is instantiated and execute() is invoked. What I want to do here is that I want to set values for begin and stop inside the execute method in the Base class just before and after the invocation of the funct() method respectively (as shown using comments) so that whenever we create an object for Derived, say obj_derived, it has the same values for begin and stop as set inside the execute().
Thank you very much for any replies.     

A:

In your Base class definition:
struct DataType{
...
} dt;    //now there is a member 'dt' of type 'struct DataType'

and in execute method;
void execute()
{
   this->dt.set_begin(1);
   funct(); 
   this->dt.set_stop(1);
}

also in Derived class definition comment out:
//DataType dt;

