2016-04-01 20 views

答えて

1

を変更するにはどうすればよい

はかなり簡単です:単に

#include <chrono> 
#include <string> 

auto now = std::chrono::system_clock::now(); 
auto now_sec = std::chrono::duration_cast<std::chrono::seconds>(now.time_since_epoch()); 
auto now_sec_str = std::to_string(now_sec.count()); 

または:

#include <ctime> 
#include <string> 

auto now_sec_str = std::to_string(long(std::time(nullptr))); 

ことそれからちょうど追加しますあなたのフォルダ名に:

myfile.open("/FILE_FOLDER/" + now_sec_str); 
+0

私はプログラミングの専門家ではないので私がはっきりしない場合は申し訳ありません。問題は、その時間を追加し、上記のステートメントにそれを含めることです。 – Rok

+1

あなたは/ FILE_FOLDER/"+ now_sec_str'を行うには専門家である必要はありませんが、とにかくその情報で回答を更新しました。 –

関連する問題