開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VS2010
問題(Question):
目前有一段程式,會重複計算並把結果存到一個txt
程式執行初期都可正常存出txt
但在大量計算約幾百次後,就無法再開啟檔案
(fp.open()後也不會有空白的txt被開啟)
請問可能是甚麼原因? 感謝!
程式碼(Code):(請善用置底文網頁, 記得排版)
char filename[]="Result.txt";
ofstream fp;
fp.open(filename, ios::out);
if(!fp)
fp.open(filename, ios::out);
if(fp)
{
fp << xxxxxx;
fp << endl;
}
fp.close();