本文来说个小技巧:
#include <iostream>
using namespace std;
int main()
{
cout << "hello world" << endl;
return 0;
}
不改代码, 怎么把上述log导入到文件呢? 简单搞起:
xxxxxx:~> g++ test.cpp
xxxxxx:~> ./a.out > a.txt
xxxxxx:~> cat a.txt
hello world
xxxxxx:~>
不多说。