From 52a5ea57e19ab2d70b05d09379e036d10d705df3 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Wed, 17 Apr 2024 08:29:30 -0400 Subject: [PATCH] Trying and failing to break ex11.c --- lcthw/ex11.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lcthw/ex11.c b/lcthw/ex11.c index 4fb2f95..bb5d70c 100644 --- a/lcthw/ex11.c +++ b/lcthw/ex11.c @@ -3,15 +3,21 @@ int main(int argc, char *argv[]) { int numbers[4] = { 0 }; - char name[4] = { 'a' }; + char name[4] = { 'a', 'a', 'a', 'a' }; // first, print them out raw printf("numbers: %d %d %d %d\n", numbers[0], numbers[1], numbers[2], numbers[3]); + printf("numbers: %c %c %c %c\n", + numbers[0], numbers[1], numbers[2], numbers[3]); + printf("name each: %c %c %c %c\n", name[0], name[1], name[2], name[3]); + printf("name each: %d %d %d %d\n", + name[0], name[1], name[2], name[3]); + printf("name: %s\n", name); // setup the numbers @@ -24,7 +30,7 @@ int main(int argc, char *argv[]) name[0] = 'Z'; name[1] = 'e'; name[2] = 'd'; - name[3] = '\0'; + name[3] = 'A'; // then print them out initialized printf("numbers: %d %d %d %d\n",