Michael Planner
/
InitListen
Codeschnippseln für diese Übung
class2.cpp@1:c65875995efb, 2020-10-13 (annotated)
- Committer:
- Aagrus
- Date:
- Tue Oct 13 16:34:21 2020 +0000
- Revision:
- 1:c65875995efb
- Parent:
- 0:76d9c940a794
UPDATE: Hinzugefuegt -> Ueberladener Konstruktor
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Aagrus | 0:76d9c940a794 | 1 | class MyClassA |
Aagrus | 0:76d9c940a794 | 2 | { |
Aagrus | 0:76d9c940a794 | 3 | private: |
Aagrus | 0:76d9c940a794 | 4 | int _x; |
Aagrus | 0:76d9c940a794 | 5 | bool _wahr; |
Aagrus | 0:76d9c940a794 | 6 | |
Aagrus | 0:76d9c940a794 | 7 | public: |
Aagrus | 1:c65875995efb | 8 | MyClassA() : _x(0), _wahr(false) |
Aagrus | 1:c65875995efb | 9 | { |
Aagrus | 1:c65875995efb | 10 | |
Aagrus | 1:c65875995efb | 11 | } |
Aagrus | 1:c65875995efb | 12 | MyClassA(int x) : _x(x), _wahr(false) |
Aagrus | 1:c65875995efb | 13 | { |
Aagrus | 1:c65875995efb | 14 | |
Aagrus | 1:c65875995efb | 15 | } |
Aagrus | 0:76d9c940a794 | 16 | MyClassA(int x, bool wahr) : _x(x), _wahr(wahr) |
Aagrus | 0:76d9c940a794 | 17 | { |
Aagrus | 1:c65875995efb | 18 | |
Aagrus | 0:76d9c940a794 | 19 | } |
Aagrus | 1:c65875995efb | 20 | |
Aagrus | 1:c65875995efb | 21 | |
Aagrus | 1:c65875995efb | 22 | |
Aagrus | 0:76d9c940a794 | 23 | int GetX(void) {return _x;} |
Aagrus | 1:c65875995efb | 24 | bool GetBool(void) {return _wahr;} |
Aagrus | 0:76d9c940a794 | 25 | }; |