K&R C Programs Exercise 5-11

Exercise 5-11. Modify the programs entab and detab (written as exercises in Chapter 1) to accept a list of tab stops as arguments. Use the default tab settings if there are no arguments. The Chapter 1 versions of entab and detab used a fixed tab width of 8. This version reads tab stop positions from …

K&R C Exercise 1-20: detab — Replace Tabs with Spaces

Exercise 1-20. Write a program detab that replaces tabs in the input with the proper number of blanks to space to the next tab stop. Assume a fixed set of tab stops, say every n columns. Should n be a variable or a symbolic parameter? Approach The key insight is that a tab does not …