From 82d318879c897b3d665767d74806cd33fe6791c0 Mon Sep 17 00:00:00 2001 From: zlg Date: Tue, 23 Apr 2013 13:33:25 -0500 Subject: Add exercise descriptions and answers for ch1 * Corrected behavior in solutions for 1-9 and 1-23 --- ch1/1-21_entab.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'ch1/1-21_entab.c') diff --git a/ch1/1-21_entab.c b/ch1/1-21_entab.c index 6037a14..2833520 100644 --- a/ch1/1-21_entab.c +++ b/ch1/1-21_entab.c @@ -1,15 +1,14 @@ #include /* The C Programming Language: 2nd Edition - * Exercise 1-21: - * "Write a program `entab` that replaces strings of blanks by the minimum - * number of tabs and blanks to achieve the same spacing. Use the same tab - * stops as for `detab`. When either a tab or a single blank would suffice to - * reach a tab stop, which should be given preference?" + * + * Exercise 1-21: Write a program `entab` that replaces strings of blanks by + * the minimum number of tabs and blanks to achieve the same spacing. Use the + * same tab stops as for `detab`. When either a tab or a single blank would + * suffice to reach a tab stop, which should be given preference? * * Answer: A blank. A tab character that comes after (tabstop - 1) blanks makes * little-to-no sense and could mess up alignment in some environments. - * */ #define TABWIDTH 8 -- cgit v1.2.3-54-g00ecf