怎么办?当你试图回答这个问题时,试着更具体一点。没有额外的细节。我收到一个错误
no match for operator<< in theFileIn<<number
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
int number;
string name;
ofstream theFileOut;
ifstream theFileIn;
theFileOut.open("Sansa.txt");
cout << "Enter the number and the name"<<endl;
while(cin>> number>> name)
{
theFileOut<<number<<" "<<name<<endl;
}
theFileOut.close();
theFileIn.open("sansa.txt");
while(theFileIn>>number>>name)
{
theFileIn << number<<" "<<name<<endl;
}
return 0;
}