Reversion 1:
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
int main (int argc, char **argv)
{
std::stringstream logf_n;
logf_n << "/tmp/MyApp_" << time(0) << ".log";
std::ofstream logf(logf_n.str().c_str());
logf << "Hello World" << std::endl;
logf.close();
return 0;
}