Skip to content

Instantly share code, notes, and snippets.

View Staler2019's full-sized avatar

JiaJyun Yang Staler2019

  • 漢昕科技
  • Taichung, Taiwan
  • 15:36 (UTC +08:00)
  • LinkedIn in/jiajyun-yang
View GitHub Profile
@Staler2019
Staler2019 / cerr2file.cpp
Last active November 7, 2022 13:41 — forked from AndreLouisCaron/gist:1841061
C++ std::cerr redirect to file.
#define __TEST__
#ifdef __TEST__
#include <sstream>
// redirect outputs to another output stream.
class redirect_outputs {
std::ostream &myStream;
std::streambuf *const myBuffer;