From 25fe680d4a827619a9c2e20d6064ee38c35555db Mon Sep 17 00:00:00 2001 From: localhorst Date: Sat, 16 Jun 2018 14:08:20 +0200 Subject: [PATCH] Dateien hochladen nach 'Uebungen' --- Uebungen/01_AdvC01.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Uebungen/01_AdvC01.cpp diff --git a/Uebungen/01_AdvC01.cpp b/Uebungen/01_AdvC01.cpp new file mode 100644 index 0000000..3a60357 --- /dev/null +++ b/Uebungen/01_AdvC01.cpp @@ -0,0 +1,28 @@ +/* + * C1.cpp + * + * Created on: 03.05.2018 + * Author: hendrik + */ + +#include +using namespace std; + +unsigned int app(unsigned short int us1, unsigned short int us2) { + + unsigned int ret = us1; + ret = ret << 8; + ret = ret + us2; + return ret; +} + +int main() { + unsigned int (*appPointer)(unsigned short int, unsigned short int); + appPointer = app; + unsigned short int us1 = 10; + unsigned short int us2 = 10; + printf("us1: %x\n", us1); + printf("us2: %x\n", us2); + printf("Ergebnis: %04x ", appPointer(us1, us2)); + return 0; +}