From 32aec247e56e9df31e849d885df2c5cf075663bc Mon Sep 17 00:00:00 2001 From: Walt Mankowski Date: Sun, 22 Jun 2025 10:38:18 -0400 Subject: changed output array type to unsigned int --- challenge-326/walt-mankowski/c/ch-2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/challenge-326/walt-mankowski/c/ch-2.c b/challenge-326/walt-mankowski/c/ch-2.c index a73873c380..415aff1ec3 100644 --- a/challenge-326/walt-mankowski/c/ch-2.c +++ b/challenge-326/walt-mankowski/c/ch-2.c @@ -11,7 +11,7 @@ int main (int argc, char *argv[]) { size_t output_size = 0; for (int i = 1; i < argc; i += 2) output_size += atoi(argv[i]); - int *output = malloc(output_size * sizeof(int)); + unsigned int *output = malloc(output_size * sizeof(unsigned int)); /* add things to the output array */ int k = 0; @@ -25,6 +25,6 @@ int main (int argc, char *argv[]) { /* print out the array */ printf("("); for (int i = 0; i < output_size-1; i++) - printf("%d, ", output[i]); - printf("%d)\n", output[output_size-1]); + printf("%u, ", output[i]); + printf("%u)\n", output[output_size-1]); } -- cgit