[問題] 關於dev-C++讀入txt檔
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
DEV-C++ 4.9.9.2
問題(Question):
讀檔一直失敗
預期的正確結果(Expected Output):
測20題數據,一次測一題
錯誤結果(Wrong Output):
'ifstream' undeclared
程式碼(Code):(請善用置底文網頁, 記得排版)
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
char filename[20];
ifstream in("topic_%dX%d_%d.txt",m,n,g);
if(in.fail()){cout << "開檔錯誤" << endl; exit(1)};
for(i=0;i<m;i++)
{
for (j=0;j<n;j++)
{
in >> p[i][j];
}
}
fclose (pfile);
補充說明(Supplement):
查了一些網頁,但就是一直編譯不過,麻煩各位神手了!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.134.72.65
→
06/26 12:13, , 1F
06/26 12:13, 1F
→
06/26 12:18, , 2F
06/26 12:18, 2F
→
06/26 12:36, , 3F
06/26 12:36, 3F
→
06/26 14:04, , 4F
06/26 14:04, 4F
→
06/26 14:04, , 5F
06/26 14:04, 5F
→
06/26 14:04, , 6F
06/26 14:04, 6F
→
06/26 14:05, , 7F
06/26 14:05, 7F
→
06/26 14:48, , 8F
06/26 14:48, 8F
→
06/26 14:57, , 9F
06/26 14:57, 9F
推
06/26 15:16, , 10F
06/26 15:16, 10F
→
06/26 15:16, , 11F
06/26 15:16, 11F
→
06/26 16:54, , 12F
06/26 16:54, 12F
→
06/26 16:54, , 13F
06/26 16:54, 13F
→
06/26 17:37, , 14F
06/26 17:37, 14F
→
06/26 22:46, , 15F
06/26 22:46, 15F