diff options
| author | Walt Mankowski <waltman@pobox.com> | 2025-06-22 10:38:18 -0400 |
|---|---|---|
| committer | Walt Mankowski <waltman@pobox.com> | 2025-06-22 10:38:18 -0400 |
| commit | 32aec247e56e9df31e849d885df2c5cf075663bc (patch) | |
| tree | 00313a680ea6690311da14a95de43df756fd50d6 | |
| parent | 51148c8ad32d4fec91227db07697a9ab1c52e1cd (diff) | |
| download | perlweeklychallenge-club-32aec247e56e9df31e849d885df2c5cf075663bc.tar.gz perlweeklychallenge-club-32aec247e56e9df31e849d885df2c5cf075663bc.tar.bz2 perlweeklychallenge-club-32aec247e56e9df31e849d885df2c5cf075663bc.zip | |
changed output array type to unsigned int
| -rw-r--r-- | challenge-326/walt-mankowski/c/ch-2.c | 6 |
1 files 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]); } |
