From f9003d89b17c039ab903f622580e61925e137523 Mon Sep 17 00:00:00 2001 From: klaar36 Date: Mon, 20 Mar 2017 17:59:45 +0100 Subject: added given files for standalone labs --- src/standalone/upg7/debug.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/standalone/upg7/debug.c (limited to 'src/standalone/upg7') diff --git a/src/standalone/upg7/debug.c b/src/standalone/upg7/debug.c new file mode 100644 index 0000000..d6a3707 --- /dev/null +++ b/src/standalone/upg7/debug.c @@ -0,0 +1,27 @@ +#include + +int main() +{ + char str[] = "sihtgubed"; + char *stri = &str[8]; + char *buf[9]; + char **bufi, **bufend; + bufi = buf; + bufend = &buf[9]; + + while (bufi != bufend){ + *bufi = stri; + bufi++; + stri--; + } + + while (bufi != buf){ + *(*bufi) -= 32; + bufi--; + } + + while (bufi != bufend){ + printf("%c", **bufi); + bufi++; + } +} -- cgit v1.2.1