aboutsummaryrefslogtreecommitdiffstats
path: root/src/standalone/labx4
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-03-17 01:47:23 +0100
committerGustav Sörnäs <gustav@sornas.net>2021-03-17 01:47:23 +0100
commit185f7edbf34d9926bb0083281fa61e800887eff8 (patch)
treef0abfd8a4be5eb951a4d7fde7a7ac367c05a6b8f /src/standalone/labx4
parent6dab587f279e5320dc3fc2dcc9977af98a323c33 (diff)
parentb7002c53057d4ae049237786d26f00a762dbc2ea (diff)
downloadpintos-rs-main.tar.gz
Merge remote-tracking branch 'upstream/master'main
Diffstat (limited to 'src/standalone/labx4')
-rw-r--r--src/standalone/labx4/debug.c27
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++;
+ }
+}