麻烦了解`tabs`。 [英] Trouble understanding `tabs`.
问题描述
我读C程序设计语言。我有麻烦34页的了解练习1-20:
I am reading "The C Programming Language." I am having trouble understanding Exercise 1-20 on page 34:
写一个程序detab,在用空格适当数量的空间到下一个制表位输入替换标签。假设一组固定的制表位,例如每n列。如果n为变量或符号参数?
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?
第二句话是什么,我不明白。
The second sentence is what I do not understand.
推荐答案
让我们画出来直观,使用标签是四个空格,每个|再presenting下一个制表:
Let's draw it out visually, with tabs being four spaces and each | representing the next tab stop:
|---|---|---|---|
所有句话的意思是,如果你在任何一个连字符( - )和选项卡从那里,它关系到一个制表位(|),而不是四个空格前面所有的时间
All the sentence means is that if you're at any of the hyphens (-) and tab from there, it goes to a tab stop (|) instead of four spaces ahead all the time.
|---|---|---|---|
^press tab here
|---|---|---|---|
^end up here
这篇关于麻烦了解`tabs`。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!