K&R 任务练习 5.17
有人能解释一下练习 5.17 中具体需要做什么吗?在行及其字段内排序是什么意思?
Can someone explain what specifically needs to be done in exercise 5.17, what does it mean to sort within line, its field?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我这里没有 K&R 的副本。我认为这意味着这个
假设原始文件
已经按第一个字段排序了;如果您想按第二个字段(名称)排序,结果将是
或者您可以按日期排序(第三个字段)
I don't have my copy of K&R here. I think it means this
Suppose the original file has
It is already sorted by the 1st field; if you want to sort it by the 2nd field (the name) the result would be
Or you can sort by date (the 3rd field)
您必须找到一种方法将一行拆分为多个字段,然后能够说“对字段 N 进行排序”
You must find a way to split a line into fields and then be able to say "sort on field N"