......然后我可以使用什么 [英] ...Then what can I USE

查看:70
本文介绍了......然后我可以使用什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我上一篇文章的后续文章中;


任何人都知道如何接受文字句子(即空格

字符);因为scanf(%s)导致输入在空格

字符后终止。


干杯。

In follow-up to my previous post;

Would any one know how I can intake sentences of text (i.e. With space
characters); because scanf("%s") causes input to terminate after a space
character.

Cheers.

推荐答案

Radith写道:
Radith wrote:
是否有人知道如何接受文本句子(即空格
字符);因为scanf(%s)导致输入在空格
字符后终止。
Would any one know how I can intake sentences of text (i.e. With space
characters); because scanf("%s") causes input to terminate after a space
character.




如何定义句子?对于高达EOL的字符串,请使用

fgets。对于以点(句点)结尾的字符串,问题

标记或感叹号 - 我不知道Dan Pop(居民

scanf专家),但我会写自己的功能。


彼得



How do you define a sentence? For strings of characters up to EOL, use
fgets. For strings of characters ending with a dot (period), question
mark or exclamation mark - I don''t know about Dan Pop (the resident
scanf expert), but I would write my own function.

Peter


" Radith" < RA **** @ xtra.co.nz>写道:
"Radith" <ra****@xtra.co.nz> writes:
在我上一篇文章的后续文章中;


然后请将其作为后续内容发布,而不是作为新文章。

任何人都知道我如何能够接受文本句子(即带空格
字符);因为scanf(%s)导致输入在空格
字符后终止。
In follow-up to my previous post;
Then please post it as a followup, not as a new article.
Would any one know how I can intake sentences of text (i.e. With space
characters); because scanf("%s") causes input to terminate after a space
character.




系统或任何体面的教科书中找到相关文档。


-

Keith Thompson (The_Other_Keith) ks***@mib.org < http://www.ghoti.net/~kst>

圣地亚哥超级计算机中心< *> < http://users.sdsc.edu/~kst>

我们必须做点什么。这是事情。因此,我们必须这样做。



fgets(). You should be able to find documentation on it on your
system or in any decent textbook.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.


Radith写于31/07/05:
Radith wrote on 31/07/05 :
是否有人知道如何接受文本句子(即带空格
字符);因为scanf(%s)导致输入在空格
字符后终止。
Would any one know how I can intake sentences of text (i.e. With space
characters); because scanf("%s") causes input to terminate after a space
character.




使用fgets()获取一行文本。


-

Emmanuel

C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html

C库: http://www.dinkumware.com/refxc .html


C是一个敏锐的工具



Use fgets() to get a line of text.

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

"C is a sharp tool"


这篇关于......然后我可以使用什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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