程序有问题么?
#include <fstream>using namespace std;
int main()
{
ifstream in_stream;
ofstream out_stream;
in_stream.open("1.txt");
out_stream.open("2.txt");
int first, second;
in_stream >> first >> second;
out_stream <<"The sum of these two numbers is:\n"
<< (first + second) << endl;
in_stream.close();
out_stream.close();
return 0;
}
电脑桌面放着1.tet和2.txt,前者有数字1和2,后者是空的,但执行程序后没见2.texyou变化,不知是和情况,望高手指点~