文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>C++ Code Snippet (1)

C++ Code Snippet (1)

时间:2010-10-07  来源:AnswerYi



C++ File Operation  1 
 2 void FileHandle(string name,string outfile)
 3 {
 4     ifstream in(name.c_str());
 5         ofstream out(outfile.c_str());
 6     
 7     if(in) {
 8         
 9         out << in.rdbuf();
10         
11     }
12     in.close();
13         out.close();
14 }

------------------------------------

时间

#include<time.h>

time_t t = time(NULL);

cout << ctime(&t);

// Thu Oct 07 12:16:08 2010

-------------------------------------

字符串

#include<string>

string str;

assign(string);

append();

c_str();

find_first_of();

substr(int start,int len);

--------------------------------------

目录操作

#include<io.h>

    _finddata_t data;
    long handle = _findfirst(“”,&data); 

 

相关阅读 更多 +
排行榜 更多 +
XLM币最具爆发力的安全交易所欧易okex下载

XLM币最具爆发力的安全交易所欧易okex下载

金融理财 下载
XEM币最安全隐私链的全球交易所欧易okex下载

XEM币最安全隐私链的全球交易所欧易okex下载

金融理财 下载
WAVES币最新上线的优质交易所欧易okex下载

WAVES币最新上线的优质交易所欧易okex下载

金融理财 下载