setting tab stops

Steve Summit scs at adam.mit.edu
Fri Jul 20 12:38:07 AEST 1990


In article <1037 at rossignol.Princeton.EDU> tr at samadams.princeton.edu (Tom Reingold) writes:
>Someone posted a very terse way of
>calculating how many spaces to move given an input of tabs.  I think it
>used the modulo operator and some bitwise operators.
>The assumption is that the terminal tabs at every eighth
>position.

Just use an obvious algorithm.  It's more likely that you'll want
to allow tab stops at arbitrary positions (i.e. not a power of
two) than that you'll save significant time by using shifts and
bitwise operators.

                                            Steve Summit
                                            scs at adam.mit.edu



More information about the Comp.lang.c mailing list