diff options
| author | klaar36 <klas.arvidsson@liu.se> | 2017-03-20 17:59:45 +0100 |
|---|---|---|
| committer | klaar36 <klas.arvidsson@liu.se> | 2017-03-20 17:59:45 +0100 |
| commit | f9003d89b17c039ab903f622580e61925e137523 (patch) | |
| tree | b46ab4f9745c96a78685ca29b6a18ed2531205d6 /src/standalone/upg7 | |
| parent | d9ae213323d0a036b7f3594de6822413a4c312c6 (diff) | |
| download | pintos-rs-f9003d89b17c039ab903f622580e61925e137523.tar.gz | |
added given files for standalone labs
Diffstat (limited to 'src/standalone/upg7')
| -rw-r--r-- | src/standalone/upg7/debug.c | 27 |
1 files changed, 27 insertions, 0 deletions
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 <stdio.h> + +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++; + } +} |
