首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

flush和endl解决方案

2012-02-23 
flush和endl#include iostream#include stringusingnamespacestdintmain(){charname[20]charname1[2

flush和endl
#include <iostream>
#include <string>
using   namespace   std;

int   main()
{
char   name[20];
char   name1[20];

cout < < "enter   name ";
cin.get(name,255, 'e ');
cout < < "name " < <name;
cout < <flush;
cin.get(name1,255);
cout < < "\nname1 " < <name1;
cout < <flush;
char   ch=cin.get();
cout < <ch;
return   0;
}
我看到说flush和endl都有刷新缓冲去的作用,可我看不到他的作用啊,加没加一样啊

[解决办法]
http://community.csdn.net/Expert/TopicView1.asp?id=5227635
不过,看到了效果也没啥意义

热点排行