From 20d3661062b7b42fcfa91cc9b43f2a6752804e62 Mon Sep 17 00:00:00 2001 From: Zhineng Li Date: Sat, 10 Jan 2026 18:15:14 +0800 Subject: ex01-13: extract bar character --- ch01/ex13-histogram.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ch01/ex13-histogram.c') diff --git a/ch01/ex13-histogram.c b/ch01/ex13-histogram.c index fbccb2a..47ed574 100644 --- a/ch01/ex13-histogram.c +++ b/ch01/ex13-histogram.c @@ -3,6 +3,8 @@ #define IN 1 /* inside a word */ #define OUT 0 /* outside a word */ +#define INDICATOR_BAR '#' + /* print a histogram of word lengths */ int main() { @@ -46,7 +48,7 @@ int main() else printf(" %2d: ", i + 1); for (j = 0; j < nlen[i]; ++j) - putchar('#'); + putchar(INDICATOR_BAR); putchar('\n'); } } -- cgit v1.2.3