Aufgabe_1

Dependencies:   mbed

Committer:
Hutzi
Date:
Tue Oct 06 16:56:36 2020 +0000
Revision:
4:0f310f0fa9ac
Parent:
3:ee41300c3883
code 2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Hutzi 1:2a6f45577cf5 1
Hutzi 1:2a6f45577cf5 2
Hutzi 0:45192de7f4d2 3 #include "mbed.h"
Hutzi 0:45192de7f4d2 4
Hutzi 1:2a6f45577cf5 5 // Hutter_6.10.2020_ Aufgabe_1
Hutzi 1:2a6f45577cf5 6
Hutzi 0:45192de7f4d2 7 class TestKlasse{
Hutzi 0:45192de7f4d2 8
Hutzi 0:45192de7f4d2 9
Hutzi 0:45192de7f4d2 10 public:
Hutzi 4:0f310f0fa9ac 11 TestKlasse(int x, bool wahr) : _x(x), _wahr(wahr) {
Hutzi 4:0f310f0fa9ac 12 _x=0;
Hutzi 4:0f310f0fa9ac 13 _wahr=false;
Hutzi 4:0f310f0fa9ac 14 }
Hutzi 4:0f310f0fa9ac 15
Hutzi 4:0f310f0fa9ac 16 int getx(void) {
Hutzi 4:0f310f0fa9ac 17
Hutzi 4:0f310f0fa9ac 18 return _x;
Hutzi 4:0f310f0fa9ac 19 }
Hutzi 4:0f310f0fa9ac 20
Hutzi 4:0f310f0fa9ac 21 private:
Hutzi 4:0f310f0fa9ac 22 int _x;
Hutzi 4:0f310f0fa9ac 23 bool _wahr;
Hutzi 0:45192de7f4d2 24 };
Hutzi 0:45192de7f4d2 25
Hutzi 4:0f310f0fa9ac 26
Hutzi 4:0f310f0fa9ac 27 TestKlasse ausgabe(15,true);
Hutzi 0:45192de7f4d2 28
Hutzi 0:45192de7f4d2 29 int main() {
Hutzi 0:45192de7f4d2 30
Hutzi 4:0f310f0fa9ac 31 int y;
Hutzi 4:0f310f0fa9ac 32 y=ausgabe.getx();
Hutzi 4:0f310f0fa9ac 33
Hutzi 4:0f310f0fa9ac 34 printf("bei 15 passts: %d\n",y);
Hutzi 0:45192de7f4d2 35
Hutzi 0:45192de7f4d2 36 }
Hutzi 0:45192de7f4d2 37
Hutzi 1:2a6f45577cf5 38
Hutzi 1:2a6f45577cf5 39