diff options
| author | Filip Strömbäck <fstromback@gmail.com> | 2021-03-16 13:01:32 +0100 |
|---|---|---|
| committer | Filip Strömbäck <fstromback@gmail.com> | 2021-03-16 13:01:32 +0100 |
| commit | b7002c53057d4ae049237786d26f00a762dbc2ea (patch) | |
| tree | f13985eaafedba1d64a6aa835bf93392186d0164 /src/standalone/labx4/debug.c | |
| parent | cda174afc8e1bf6b779726965f5eaa030d80b1dc (diff) | |
| download | pintos-rs-b7002c53057d4ae049237786d26f00a762dbc2ea.tar.gz | |
Updated names in standalone/ to match new lab numbering.
Diffstat (limited to 'src/standalone/labx4/debug.c')
| -rw-r--r-- | src/standalone/labx4/debug.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/standalone/labx4/debug.c b/src/standalone/labx4/debug.c new file mode 100644 index 0000000..d6a3707 --- /dev/null +++ b/src/standalone/labx4/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++; + } +} |
