Przykład tworzenia klas, też funkcji wirtualnej w klasie-bazie.
Revision 0:f66cecb955ba, committed 2016-03-22
- Comitter:
- kch78
- Date:
- Tue Mar 22 09:29:40 2016 +0000
- Commit message:
- 1
Changed in this revision
Shape.cpp | Show annotated file Show diff for this revision Revisions of this file |
Shape.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r f66cecb955ba Shape.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Shape.cpp Tue Mar 22 09:29:40 2016 +0000 @@ -0,0 +1,4 @@ +#include "mbed.h" +#include "Shape.h" +#include <string> +
diff -r 000000000000 -r f66cecb955ba Shape.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Shape.h Tue Mar 22 09:29:40 2016 +0000 @@ -0,0 +1,14 @@ +#ifndef MBED_SHAPE_H +#define MBED_SHAPE_H +#include "mbed.h" +#include <string> + +class Shape +{ + public: + float width; + float height; + virtual float getArea() {}; +}; + +#endif \ No newline at end of file