Skip to content
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.

Latest commit

 

History

History
36 lines (22 loc) · 436 Bytes

debugging-technique.md

File metadata and controls

36 lines (22 loc) · 436 Bytes

调试技巧

输入输出重定向

C/C++语言层面的输入输出重定向

freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);

系统层面的输入输出重定向

PowerShell

Get-Content in.txt | .\Program.exe >> out.txt

CMD

Program.exe < in.txt > out.txt

条件编译

#ifndef ONLINE_JUDGE
// Do something
#endif