Maida Ahmic
/
initialisierungsliste
Initialisierungsliste
main.cpp@0:526e53f544a8, 2020-10-06 (annotated)
- Committer:
- adiam
- Date:
- Tue Oct 06 16:39:38 2020 +0000
- Revision:
- 0:526e53f544a8
Initialisierungsliste
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
adiam | 0:526e53f544a8 | 1 | #include "mbed.h" |
adiam | 0:526e53f544a8 | 2 | class MyClass |
adiam | 0:526e53f544a8 | 3 | { |
adiam | 0:526e53f544a8 | 4 | public: |
adiam | 0:526e53f544a8 | 5 | |
adiam | 0:526e53f544a8 | 6 | MyClass( double messwert ) : _messwert(messwert) {} |
adiam | 0:526e53f544a8 | 7 | |
adiam | 0:526e53f544a8 | 8 | void status(){ |
adiam | 0:526e53f544a8 | 9 | printf("%f\n", _messwert); |
adiam | 0:526e53f544a8 | 10 | } |
adiam | 0:526e53f544a8 | 11 | private: |
adiam | 0:526e53f544a8 | 12 | |
adiam | 0:526e53f544a8 | 13 | double _messwert; |
adiam | 0:526e53f544a8 | 14 | }; |
adiam | 0:526e53f544a8 | 15 | |
adiam | 0:526e53f544a8 | 16 | MyClass myClass(0.0); |
adiam | 0:526e53f544a8 | 17 | |
adiam | 0:526e53f544a8 | 18 | int main() { |
adiam | 0:526e53f544a8 | 19 | myClass.status(); |
adiam | 0:526e53f544a8 | 20 | wait_ms(200); |
adiam | 0:526e53f544a8 | 21 | |
adiam | 0:526e53f544a8 | 22 | } |
adiam | 0:526e53f544a8 | 23 |