會寫程式的貓
2008年12月30日
讀取檔案 並儲存成另一個檔案
User:
MY BLOG
Class:
c++
,
c++ 新手保護
//讀取檔案 並儲存成另一個檔案 #include
#include
#include
using namespace std; int main(){ ifstream in("file01.cpp");//讀取檔案 ofstream out("file01-P.cpp");//寫入檔案 string s; while(getline(in,s))//若是有文字將儲存至字串 S 中 out << s << endl;//將 S 內的文字寫入進檔案 file01-P.cpp }
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言