C++  Creating a proxy variable to a member variable

Objectives :

  • myClassConstructorShuttle1.cpp
  • Using pointer to Class member variable
  • C++ function like an event.
  • pointer to Boolean data type.
    bool Engine::*bptr1 = &Engine::b1;
    // creating a proxy variable to a member varuiable
    Engine *eng = new Engine;
    Engine eng1;
    eng1.*bptr1= 1;
    eng->b1 =eng1.*bptr1; //
  • The constructor of a delegated class fires functions in base class just like an event.
  • Code: myClassConstructorShuttle1.txt

Step: 1 Create a source file.

Step: 2 Edit and save Source file

Step: 3 Runtime Views: