DEVCPP +倒带(stdin)

编程入门 行业动态 更新时间:2024-10-24 12:27:01
本文介绍了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 c-faq/ K& R2(详见常见问题解答) )。 - Flash Gordon,生活在有趣的时代。 网站 - home.flash-gordon.me.uk/ comp.lang。 c发布指南和介绍: clc-wiki/ wiki / Intro_to_clc

The comp.lang.c FAQ c-faq/ K&R2 (see the FAQ for the full reference). -- Flash Gordon, living in interesting times. Web site - home.flash-gordon.me.uk/ comp.lang.c posting guidelines and intro: clc-wiki/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...

捕获文本输入的最佳方法是一次一个字符,仅限,或者一行中的一行时间,只有。一个或另一个,你选择哪一个 取决于你在做什么。 我把一篇小文章放在一起一次捕获文本数据的主题 行,您可以在以下位置找到它: < www.cpax。 uk / prg / writings / fgetdata.php> - Richard Heathfield Usenet是一个奇怪的地方 - dmr 29/7/1999 www.cpax.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: <www.cpax.uk/prg/writings/fgetdata.php> -- Richard Heathfield "Usenet is a strange place" - dmr 29/7/1999 www.cpax.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 < www.ghoti/~kst> 圣地亚哥超级计算机中心< *> < 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 <www.ghoti/~kst> San Diego Supercomputer Center <*> <users.sdsc.edu/~kst> We must do something. This is something. Therefore, we must do this.

更多推荐

DEVCPP +倒带(stdin)

本文发布于:2023-07-11 09:11:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1093536.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:DEVCPP   stdin

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!