close

============== C++ 寫入檔案===============

#include<iostream>
#include<fstream>
using namespace std;
 
int main(){

    //開檔
    char filename[]="link.txt";
    fstream fp;
    fp.open(filename, ios::out);
     
      for (int i=1;i<20;i++)
    {
    fp<<"http://test.com/"<<i<<".ppt"<<endl; //寫入檔案
    }


    fp.close();  //關檔
    system("pause");
    return 0;
}

arrow
arrow
    文章標籤
    Code
    全站熱搜

    adminX 發表在 痞客邦 留言(0) 人氣()