转,在linux c++文件中打印日志

#include

using namespace std;

void function()
{
string str("a string");
int i(10);
ofstream of("/tmp/yourlogfile");
of << "string : " << str << 'int ' << i << endl;
}

你可能感兴趣的:(C++,linux,String,function,include)