when I remove the following snippet, it gives correct output in the terminal.
#ifndef ONLINE_JUDGE
freopen(“input.txt” , “r”, stdin);
freopen(“output.txt” , “w” , stdout);
#endif
how to troubleshoot this?
when I remove the following snippet, it gives correct output in the terminal.
#ifndef ONLINE_JUDGE
freopen(“input.txt” , “r”, stdin);
freopen(“output.txt” , “w” , stdout);
#endif
how to troubleshoot this?
The Sublime Text build environment is not a terminal device and fiddling with the stdio streams is generally not going to work as expected. Try the Terminus plugin instead.
I deleted both input.txt and output.txt file from parent directory and then created input.txt and output.txt file again and now it’s working fine.