Skip to content

Commit

Permalink
Towards #14.
Browse files Browse the repository at this point in the history
Can capture standard out and standard error into a file.
So far other solutions to capture directly to a string have not worked...
  • Loading branch information
shaperilio committed Dec 17, 2020
1 parent 4a1024a commit f3af370
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@
#include "definitions.h"
#include <iostream>

#include <stdio.h>

using namespace std;
void redirectOutput(char const * const filename) {
freopen(filename, "w", stdout);
freopen(filename, "w", stderr);
printf("printf works\n");
cout << "cout works\n";
}

int main(int argc, char *argv[])
{
// redirectOutput("output.txt");

#ifdef _DEBUG
omp_set_num_threads(1);
#else
Expand Down

0 comments on commit f3af370

Please sign in to comment.