Originally posted by Betazep
class abc {
private:
int x;
public:
abc();
int getx();
};
you got it....
The thing is... who cares about the structure of the class? It means nothing. Just a bunch of lines that state which functions can be utilized. (and your class implementor needs to know that anyway... how can he/she call a public member function if the name and argument list isn't available? He/she can't...)
This is why we hide the implementation, but give them the function prototypes in the header file...
Take care... look forward to working through more issues with you in the future....
Well, the structure of class may lead to some hints to my friend's homework. Therefore it's perfect to have it hidden too.
And you asked "how can he/she call a public member function if the name and argument list isn't available? ". In most case you are right. But you know, this is a piece of homework. So, everyone in my class know how to implement the class.
Nice to chat/work with you. You are really helpful.