Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- class classA {
- public:
- void classAprint() {
- using namespace std;
- cout << "classA print" << endl;
- }
- };
- class classB {
- public:
- void classBprint() {
- myclassA.classAprint(); // why don't this work?
- }
- };
- int main () {
- classA myclassA;
- classB myclassB;
- myclassA.classAprint(); // this work.
- myclassB.classBprint(); // why don't this work?
- return 0;
- }
Add Comment
Please, Sign In to add comment