freopen("C:\\in.txt","r",stdin);
freopen("out.txt","w",stdout);
while(cin>>a>>b)
cout<<a+b<<" ";
fclose(stdin);//关闭文件
fclose(stdout);//关闭文件
我的问题是:如果键盘是作为输入数据的源头(也就是stdin?),输入的数据跑到输入缓冲区,然后cin从缓冲区里面读取。那么我 这样freopen("C:\\in.txt","r",stdin);,便是从in.txt读取,源头变成in.txt???? 是否不需要缓冲区了?还是说,文本的数据跑到输入缓冲区了?stdin在这里是指文本吗????麻烦解答下