C++ : delegating one class by another

Objectives :

  • myClassDelegation2.cpp
    In C++ one class can encapsulate (hide another class), and delegates for the encapsulated class.
  • The events like action in C# , can be simulated in C++ . Basically, a events is fired by calling a function, and which in turn will expose some other functions.
  • Here a class delegates another class
  • Code: myClassDelegation2.txt

Step: 1 Create a source file.

Step: 2 Edit and save Source file


Step: 3 Runtime Views: