我不太明白这个练习...... [英] I don't quite understand this exercise...

查看:86
本文介绍了我不太明白这个练习......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不太明白K& R希望我在练习1-20中的The

C编程语言,第2版中做些什么。这里是描述:


"写一个程序detab,用适当的

空格数替换输入中的制表符到下一个空格制表位。假设一组固定的

制表符停止,比如每n列。应该是变量还是符号

参数?"


这是什么意思?他们是否希望我弄清楚我的系统选项卡占用的空格数量是多少?并添加它们?我有点困惑

这个问题。


-

Patrick M.

/ * EOF * /

I don''t quite understand what K&R want me to do in Exercise 1-20 in "The
C Programming Language, 2nd Edition". Here''s the description:

"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?"

What does this mean? Do they want me to figure out the amount of spaces
a tab takes up on my system, and add them? I''m sort of confused about
this question.

--
Patrick M.
/* EOF */

推荐答案

" Patrick M." <无*** @ nowhere.com>在消息中写道

新闻:bZ ******************** @ comcast.com ...
"Patrick M." <no***@nowhere.com> wrote in message
news:bZ********************@comcast.com...
我我不太明白K& R希望我在The C / C编程语言,第2版的练习1-20中做些什么。这里是描述:

"编写一个程序detab,它将输入中的选项卡替换为适当的空白数量空格到下一个制表位。假设一组固定的
制表位,例如每n列。应该是变量还是符号
参数?

这是什么意思?他们是否希望我弄清楚选项卡在我的系统上占用的空间数量,并添加它们?我对这个问题感到困惑。
I don''t quite understand what K&R want me to do in Exercise 1-20 in "The
C Programming Language, 2nd Edition". Here''s the description:

"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?"

What does this mean? Do they want me to figure out the amount of spaces
a tab takes up on my system, and add them? I''m sort of confused about
this question.




你可以假设一个固定的音高字体,但是你应该假设一个固定的标签尺寸吗? />

-

Chqrlie。



You can assume a fixed pitch font, but should you assume a fixed tab size ?

--
Chqrlie.


>"写一个替换标签的程序输入正确的
>"Write a program detab that replaces tabs in the input with the proper
空格数到空格到下一个制表位。假设一组固定的
制表位,例如每n列。应该是变量还是符号
参数?

这是什么意思?他们是否希望我弄清楚选项卡在我的系统上占用的空间数量,并添加它们?我对这个问题感到困惑。
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?"

What does this mean? Do they want me to figure out the amount of spaces
a tab takes up on my system, and add them? I''m sort of confused about
this question.




让我问一个我认为有关的问题:你是否需要

重新编译程序,从假设制表符每4个b / b
列到每8列,或者这应该是命令行

参数?


Gordon L. Burditt



Let me ask a question I think is related: should you have to
recompile the program to change from assuming tab stops every 4
columns to every 8 columns, or should this be a command-line
parameter?

Gordon L. Burditt


Patrick M.写道:
Patrick M. wrote:
我不太喜欢了解K& R希望我在The C / C编程语言,第2版的练习1-20中做些什么。这里是描述:

"编写一个程序detab,它将输入中的选项卡替换为适当的空白数量空格到下一个制表位。假设一组固定的
制表位,例如每n列。应该是变量还是符号
参数?

这是什么意思?他们是否希望我弄清楚选项卡在我的系统上占用的空间数量,并添加它们?我对这个问题感到困惑。
I don''t quite understand what K&R want me to do in Exercise 1-20 in "The
C Programming Language, 2nd Edition". Here''s the description:

"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?"

What does this mean? Do they want me to figure out the amount of spaces
a tab takes up on my system, and add them? I''m sort of confused about
this question.




他们的意思是:写一个程序来读取带有标签的文本文件(或标准输入)和

用等效空格字符替换所有选项卡。结果

应该是输出文件(或stdout)。这是一种通用类型的程序

称为过滤器,它接受一个输入文件并生成一个相关的

输出文件,并带有一些定义的修改。


他们建议您可能希望允许某种方式指定输入文件假定的

制表符间距或制表符列。这可以用命令行参数完成




Thad



They mean: write a program to read a text file (or stdin) with tabs and
replace all the tabs with equivalent space characters. The result
should be an output file (or stdout). This is a general type of program
known as a filter, which takes one input file and produces an associated
output file with some defined modification.

They are suggesting that you might want to allow some way to specify the
tab spacing or tab columns that your input file assumes. That can be
done with a command line parameter.

Thad


这篇关于我不太明白这个练习......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆