How do I make my class public?

If you want to make the class public to only some other class of your application, but not to the complete application, you should declare that other class a friend , e.g.: class SomeOtherClass; class MyClass { friend SomeOtherClass; public: MyClass(); ~MyClass(); int getValue() const; private: void setValue(int i); };

Sizin İçin Seçtik  What are objects in Java give five examples?

Leave a Reply

Your email address will not be published. Required fields are marked *