[問題] BCB讀TXT檔問題
開發平台(Platform): BCB
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
我使用BCB讀入TXT檔存入Buffer 檔案裡面包含N*1矩陣的Float
範例檔矩陣530行的Float
但是讀出Size為9xxx 且數值跟TXT檔裡完全不同
void __fastcall TForm1::Button1Click(TObject *Sender)
{
float apo;
if(!OpenDialog1->Execute()) return;
TMemoryStream *Bytestream = new TMemoryStream();
Bytestream->LoadFromFile(OpenDialog1->FileName);
int t_filesize = Bytestream->Size;
for(int index=0;index<t_filesize;index++)
Bytestream->Read(&apo,index);
delete Bytestream;
}
t_filesize 數值是錯的
Bytestream 數值也是錯的
請問是哪裡出了問題??
TXT檔內容如下:
-1.0000000e+000
-1.0000000e+000
-1.0000000e+000
-1.0000000e+000
-1.0000000e+000
-1.0000000e+000
....
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.41.121.222
推
05/22 14:58, , 1F
05/22 14:58, 1F
→
05/22 15:00, , 2F
05/22 15:00, 2F
→
05/22 15:00, , 3F
05/22 15:00, 3F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章