64,648
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <fstream>
using namespace std;
void print(const ifstream& in)
{
char ch;
in>>ch;//这里报错 ambiguous overload for 'operator>>' in 'in >> ch'
cout<<ch;
}
int main(void)
{
ifstream fin("testtext.txt");
char ch;
//print(fin);
fin>>ch;//这里正常
cout<<ch<<endl;
//print(cin);
fin.close();
system("pause");
return 0;
}