i'm new to c++, i was wondering if somebody could clarify something for me about encapsulation, for example if you have 2 classes
class Music {
private:
int a;
public:
int b();
int C();
};
class Record: public Music {
private:
char c;
int a;
float b();
protected:
int d();
void e();
public:
char f();
int g();
};
what are the member functions here of class Record that can access private data of class Record, and which member functions of class Record can access private data of class Music. and if there is a external routine that has an object instance of class Record, what member functions of class Record can it access. also if a new class newRecord is derived from class Record, what member functions in Record can newRecord access?
also does anybody know why compiler says it is dangerous to convert base class pointer into a derived class pointer, whats dangerous about it.