文件的输入输出的问题,求救!!
#include<iostream>
#include<string>
#include <fstream>
using namespace std;
void main()
{
int HouseWidth;
int HouseLength;
const int FarmWidth = 3000;
const int FarmLength = 1000;
const int F=FarmWidth * FarmLength;
const int H=HouseWidth * HouseLength;
ofstream fout("d:\test\out.txt");
if(!fout){
cerr<<"cant open";
exit(-1);
}
ifstream fin("d:\test\int.txt");
if(!fin){
cerr<<"cant open";
exit(-1);
}
cout<<"please intput the HouseWidth (0-2999)\n";
fout<<"please intput the HouseWidth (0-2999)\n";
cin>>HouseWidth;
fin>>HouseWidth;
cout<<"please intput the HouseLength (0-999)\n";
fout<<"please intput the HouseLength (0-999)\n";
cin>>HouseLength;
fin>>HouseLength;
fout<<F<<H;
fin.close();
fout.close();
}
编译后出现
Loaded 'C:\WINNT\System32\ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\kernel32.dll', no matching symbolic information found.
The thread 0x38C has exited with code -1 (0xFFFFFFFF).
The program 'D:\test\Debug\test.exe' has exited with code -1 (0xFFFFFFFF).
我就根本没有机会输入数据
出现的dos画面迅速的没了
各位老大怎么办?、