Skip to content

Instantly share code, notes, and snippets.

@HaiyangXu
Last active August 29, 2015 14:11
Show Gist options
  • Save HaiyangXu/abced50b43806b393947 to your computer and use it in GitHub Desktop.
Save HaiyangXu/abced50b43806b393947 to your computer and use it in GitHub Desktop.
Redirect Standard Input
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
inline void redirect(void)
{
#ifdef DEBUG
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
}
int main(int argc, char* argv[])
{
redirect();
//code here
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment