获取系统时间:
#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);