diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-11-28 10:40:48 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-11-28 10:40:48 +0100 |
commit | deeb409ab2b0e1aeeb5dcdc0f21ed2f2462298e5 (patch) | |
tree | 09b824e4af40af5dea774931c000d8df26cc7fe0 /oop2w3 | |
parent | adb4076e576af4990051ff18f2afd017619d077e (diff) |
fix class reference
Diffstat (limited to 'oop2w3')
-rw-r--r-- | oop2w3/A.cpp | 2 | ||||
-rw-r--r-- | oop2w3/A.h | 2 | ||||
-rw-r--r-- | oop2w3/B.cpp | 2 | ||||
-rw-r--r-- | oop2w3/B.h | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/oop2w3/A.cpp b/oop2w3/A.cpp index b6f0d57..ccdca46 100644 --- a/oop2w3/A.cpp +++ b/oop2w3/A.cpp @@ -18,7 +18,7 @@ void A::actie1(int n) { } } -void A::setB(B b) { +void A::setB(B &b) { std::cout << "A::setB(b)" << std::endl; _b = &b; } @@ -7,6 +7,6 @@ class A { B* _b; public: A(); - virtual void setB(B b); + virtual void setB(B &b); virtual void actie1(int n); }; diff --git a/oop2w3/B.cpp b/oop2w3/B.cpp index 6eb4bd2..42ae7de 100644 --- a/oop2w3/B.cpp +++ b/oop2w3/B.cpp @@ -3,7 +3,7 @@ #include "A.h" #include "B.h" -B::B(A a) { +B::B(A &a) { std::cout << "B::B(a)" << std::endl; _a = &a; _c = new C(); @@ -8,7 +8,7 @@ class B { A* _a; C* _c; public: - B(A a); + B(A &a); virtual void even(); virtual void odd(int i); virtual void actie2(int i); |