Guest User

Untitled

a guest
Jul 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. class classA {
  4. public:
  5. void classAprint() {
  6. using namespace std;
  7. cout << "classA print" << endl;
  8. }
  9. };
  10.  
  11. class classB {
  12. public:
  13. void classBprint() {
  14. myclassA.classAprint(); // why don't this work?
  15. }
  16. };
  17.  
  18. int main () {
  19. classA myclassA;
  20. classB myclassB;
  21. myclassA.classAprint(); // this work.
  22. myclassB.classBprint(); // why don't this work?
  23. return 0;
  24. }
Add Comment
Please, Sign In to add comment