DEVCPP +倒带(stdin) [英] DEVCPP + rewind(stdin)

查看:78
本文介绍了DEVCPP +倒带(stdin)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

放置rewind(stdin)的确切需要在哪里?

在printf之后?在scanf之前?

我对字符串有很多问题...

如果有人知道任何好的文件,请告诉我在哪里.. 。


谢谢。

Where is exactly neccesary to put "rewind(stdin)"?
After a printf? Before a scanf?

I have a lot of problems with strings...
If somebody know any good document, please let me know where is...

Thank you.

推荐答案

Olaf" El Blanco"写道:
Olaf "El Blanco" wrote:
在哪里完全需要放置rewind(stdin)?
在printf之后?在扫描之前?


我从来不需要把它放在任何地方。另一方面,我需要

才能在等待输入之前使用fflush(stdout)。

我对字符串有很多问题...
如果有人知道任何好的文件,请告诉我在哪里...
Where is exactly neccesary to put "rewind(stdin)"?
After a printf? Before a scanf?
I''ve never needed to put it anywhere. I have, on the other hand, needed
to use fflush(stdout) before waiting for input.
I have a lot of problems with strings...
If somebody know any good document, please let me know where is...




comp.lang.c FAQ http://c-faq.com/

K& R2(详见常见问题解答) )。

-

Flash Gordon,生活在有趣的时代。

网站 - http://home.flash-gordon.me.uk/

comp.lang。 c发布指南和介绍:
http://clc-wiki.net/ wiki / Intro_to_clc



The comp.lang.c FAQ http://c-faq.com/
K&R2 (see the FAQ for the full reference).
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc


Olaf" El Blanco"说:
Olaf "El Blanco" said:
完全需要放置rewind(stdin)的地方?


我一生中从未这样做过。


想想它会是什么意思。


puts(亲爱的用户:我知道你刚刚花了最后二十年);

put(分钟输入所有这些东西,我感谢你);

put(它 - 但现在我希望你再次完成所有这一切,确切地说);

put(和你做的那样相同)最后一次。;;


倒带(stdin);


我没看到该程序持续到第二次运行。

打印出来之后?在扫描之前?


两者都没有。

我对字符串有很多问题...
如果有人知道任何好文件,请告诉我哪里有...
Where is exactly neccesary to put "rewind(stdin)"?
I''ve never done that in my life.

Think about what it would mean.

puts("Dear user: I know you have just spent the last twenty");
puts("minutes typing in all that stuff, and I thank you for");
puts("it - but now I''d like you to do it all again, EXACTLY");
puts("THE SAME as you did it last time.");

rewind(stdin);

I don''t see that program lasting through to a second run.
After a printf? Before a scanf?
Neither.
I have a lot of problems with strings...
If somebody know any good document, please let me know where is...




捕获文本输入的最佳方法是一次一个字符,仅限
,或者一行中的一行时间,只有。一个或另一个,你选择哪一个

取决于你在做什么。


我把一篇小文章放在一起一次捕获文本数据的主题

行,您可以在以下位置找到它:


< http://www.cpax.org。 uk / prg / writings / fgetdata.php>


-

Richard Heathfield

Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上面的域名(但显然放弃了www)



The best way to capture text input is either a single character at a time,
ONLY, or a line at a time, ONLY. One or the other, and which one you choose
depends on what you''re doing.

I''ve put a little essay together on the subject of capturing text data a
line at a time, and you can find it at:

<http://www.cpax.org.uk/prg/writings/fgetdata.php>

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)


Richard Heathfield< in **** *@invalid.invalid>写道:
Richard Heathfield <in*****@invalid.invalid> writes:
Olaf" El Blanco"说:
Olaf "El Blanco" said:
完全需要放置rewind(stdin)?
Where is exactly neccesary to put "rewind(stdin)"?



我从来没有在我的生活。

想想它意味着什么。

把(亲爱的用户:我知道你刚刚度过了最后的二十年);
把( 分钟输入所有这些东西,我感谢你们;)
把(它 - 但现在我希望你再次完成这一切,确切地说);
把(就像你上次那样做的。);

倒带(stdin);

我看不到这个节目持续到一秒钟运行。



I''ve never done that in my life.

Think about what it would mean.

puts("Dear user: I know you have just spent the last twenty");
puts("minutes typing in all that stuff, and I thank you for");
puts("it - but now I''d like you to do it all again, EXACTLY");
puts("THE SAME as you did it last time.");

rewind(stdin);

I don''t see that program lasting through to a second run.



[...]


如果stdin来自交互式设备,则回放()它不会

很有意义。但是,如果它来自一个磁盘文件,那么

倒带()*可能*是一件明智的事情。


但是,stdin接收其输入的源通常是在程序控制之外的
。 rewind()函数有

使用,但如果你需要倒回()某些东西,它应该是

可能是一个命名文件(打开时) fopen()),而不是stdin。


-

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

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

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


[...]

If stdin is coming from an interactive device, rewind()ing it doesn''t
make much sense. But if it''s coming from, say, a disk file, then
rewind() *might* be a sensible thing to do.

However, the source from which stdin receives its input is generally
outside the control of the program. The rewind() function has its
uses, but if you''re going to need to rewind() something, it should
probably be a named file (opened with fopen()), not stdin.

--
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.


这篇关于DEVCPP +倒带(stdin)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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