| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 584 人关注过本帖, 1 人收藏
标题:关于 fflush(stdin)
取消只看楼主 加入收藏
smile_line
Rank: 2
等 级:论坛游民
帖 子:65
专家分:19
注 册:2013-3-3
结帖率:100%
收藏(1)
已结贴  问题点数:20 回复次数:0 
关于 fflush(stdin)
我想问问fflush(stdin)究竟是什么何方神圣?我被度娘搞晕了。。。。。
为什么有时候没了它就不行了。另外,输入流和输出流到底是啥东东

代码:
#include <stdio.h>
#include <conio.h>

void main( void )
{
   int integer;
   char string[81];

   /* Read each word as a string. */
   printf( "Enter a sentence of four words with scanf: " );
   for( integer = 0; integer < 4; integer++ )
   {
      scanf( "%s", string );
      printf( "%s\n", string );
   }

   /* You must flush the input buffer before using gets. */
   fflush( stdin );
   printf( "Enter the same sentence with gets: " );
   gets( string );
   printf( "%s\n", string );
}  
搜索更多相关主题的帖子: Enter void before include 
2013-05-30 17:35
快速回复:关于 fflush(stdin)
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011354 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved