Answered Questions

  • Can I stop people deriving from my class?

    Zubair

    • Jan 18th, 2012

    Yea It is possible in C++. Here is the code snippet. "cpp using namespace std; class Sample; class SampleBase { friend class Sample; public: private: SampleBase() { } Samp...

    Amit

    • Jan 6th, 2012

    If you make all the constructor and assignment operator private of a class then logically you can prevent any other class to use your base class. Even your derived class can inherit the base class (t...