Is there an easy way to get output of system commands into a string in C++?
Heres and example of what I mean, trying to get the epoch into a string. It doesnt work of course.
#include <stdlib.h>
#include <iostream>
#include <string.h>
using namespace std;
int main(){
string t = system("date +%s");
cout << "Time " << t << endl;
return 0;
}