1樓:匿名使用者
這個主要就是把檔案讀出來,然後換儲存方式 讀的是("xx.txt","r") 存的時候用("xx.dat","wb") 檔案讀取最好用純c的寫,c++的檔案流操作不是很好,據說微軟準備放棄這塊了 我也是聽老師說的,說c++的檔案指標操作的時候經常會亂跑。。
作者可以去了解下c的檔案操作
2樓:匿名使用者
#include
#include
int main()
if((out=fopen(outfile,"w"))==null)size=0;
while(!feof(in))
printf("%d\n",size);
j=1;
k=0;
rewind(in);
while (k>7;
fprintf(out, "%d", chb );
ch=ch<<1;
}if (i==8)
fputc(' ',out);
if (j%4==0)
fputc('\n',out);
j++;
}fclose(in);
fclose(out);
return 0;
}上面的
3樓:綉乞群群
比如struct a
bitvlaue;
} v;
};然後用fread讀入,再用fprintf輸出成你想要的格式。
4樓:匿名使用者
c++中採用ifstream ifile("stu.txt")開啟原始檔,讀入資料,再用ofstream ofile("flu.dat",ios::
binary)開啟二進位制檔案,使用write(函式寫入就可以了)
c++實現:讀取文字內容 把所有字元轉換為二進位制 再儲存為一個新的檔案。
5樓:匿名使用者
不知道你是不是想問的這個,可以參考一下
#include
#include
#include
using namespace std;
int main()
filein.close();
fileout.close();}
如何將文字檔案中資料匯入到sql表中
1 建立 load.ctl 檔案 load data characterset utf8 infile d importdata datafile data.txt into table table namefields terminated by trailing nullcols id,mobi...
如何將在c語言中生成的資料儲存到文字檔案中
主要通過fprintf格式化輸出函式實現,主要 如下,程式功能,將10 12.345000 testinfo 寫入test.txt檔案 include int main int argc,char argv fprintf pf,d f s n m,f,str 寫入,test.txt檔案內容為10 ...
如何將文字檔案的內容匯入到EXCEL指定行列
先新建一來個空白的表,然後源右健 全選 點右健 設定單元格格式 文字 但後再匯入txt文字 可是你寫的是 excel匯入乙個純文字檔案 要是軟體生成的就沒辦法了 你可以 這樣 右健 全選 點右健 設定單元格格式 文字 看下,不能變回來也沒辦法 怎麼把多個txt文字的內容,批量匯入到excel指定的 ...