Robin Handy
/
Initialisierungslisten
1 Uebung
main.cpp@1:851c54e0d307, 2020-10-06 (annotated)
- Committer:
- rob117
- Date:
- Tue Oct 06 15:42:29 2020 +0000
- Revision:
- 1:851c54e0d307
- Parent:
- 0:928e720c71da
- Child:
- 2:3c3a6f0b11d2
1uebung
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rob117 | 0:928e720c71da | 1 | #include "mbed.h" |
rob117 | 1:851c54e0d307 | 2 | |
rob117 | 0:928e720c71da | 3 | class MyClass{ |
rob117 | 0:928e720c71da | 4 | public: |
rob117 | 0:928e720c71da | 5 | MyClass(double messwert) : _messwert(messwert) { |
rob117 | 0:928e720c71da | 6 | } |
rob117 | 1:851c54e0d307 | 7 | |
rob117 | 1:851c54e0d307 | 8 | void status() { |
rob117 | 1:851c54e0d307 | 9 | printf("%f\n", _messwert); |
rob117 | 1:851c54e0d307 | 10 | |
rob117 | 1:851c54e0d307 | 11 | } |
rob117 | 1:851c54e0d307 | 12 | |
rob117 | 0:928e720c71da | 13 | private: |
rob117 | 0:928e720c71da | 14 | double _messwert; |
rob117 | 0:928e720c71da | 15 | }; |
rob117 | 1:851c54e0d307 | 16 | |
rob117 | 1:851c54e0d307 | 17 | |
rob117 | 1:851c54e0d307 | 18 | MyClass myclass(0); |
rob117 | 1:851c54e0d307 | 19 | |
rob117 | 0:928e720c71da | 20 | int main() { |
rob117 | 1:851c54e0d307 | 21 | |
rob117 | 1:851c54e0d307 | 22 | myclass.status(); |
rob117 | 1:851c54e0d307 | 23 | wait_ms(500); |
rob117 | 1:851c54e0d307 | 24 | |
rob117 | 1:851c54e0d307 | 25 | } |