I have 2 classes: Database and DatabaseMgr. The functions in DatabaseMgr need to access the variables in Database. To my understanding, I can declare DatabaseMgr a friend class to Database or inherit DatabaseMgr from Database.
friend class DatabaseMgr;
So my question is, whats the difference? Do both methods give me the same outcome?Code:
class DatabaseMgr:public Database
/*functions that access the member variables of Database