c++ 获取系统时间 写txt string 转 char* 文件改名 文件删除
获取系统时间:
#include <windows.h> SYSTEMTIME systm; GetLocalTime(&systm); char time[64] = { 0 }; printf("%d %d %d %d %d %d %d", systm.wYear, systm.wMonth, systm.wDay, systm.wHour, systm.wMinute, systm.wSecond, systm.wMilliseconds); printf(" %d", systm.wDayOfWeek);
写txt:
#include <fstream> ofstream fout(outputPass, ios::_Noreplace); fout << "# Station name : " << name << endl; fout.close();
string 2 char* :
char* matrixpath = (char*)malloc(sizeof(char) * 100); strcpy(matrixpath, (outputPass + "TranslationMatrix.txt").c_str());
rename:
rename(origin_path, new_path);
remove:
remove(path);
自己选择的路,跪着也要走完。朋友们,虽然这个世界日益浮躁起来,只要能够为了当时纯粹的梦想和感动坚持努力下去,不管其它人怎么样,我们也能够保持自己的本色走下去。