I need help understanding what Exercise 5-12 is asking for in the C Programming Language book.
Posted
by marsol0x
on Stack Overflow
See other posts from Stack Overflow
or by marsol0x
Published on 2010-04-15T23:36:15Z
Indexed on
2010/04/15
23:43 UTC
Read the original article
Hit count: 217
K&R C Programming Language: pg. 105
Extend
entab
anddetab
to accept the shorthand
entab -m +n
to mean tab stops every
n
columns, starting at columnm
.
entab
replaces a number of spaces with a tab character and detab
does the opposite. The question I have concerns the tab stops and entab
. I figure that for detab
it's pretty easy to determine the number of spaces needed to reach the next tab stop, so no worries there. With entab
, replacing spaces with tabs is slightly more difficult since I cannot for sure know how large the tab character goes to its own tab stop (unless there is a way to know for sure).
Am I even thinking about this thing properly?
© Stack Overflow or respective owner