this is common thing that happened to me when i solve a problem and i want to submit it then i got WA because of i forgot to comment my testing file input... Now i saw that someone use this in main
ifdef NEREVAR_PROJECT
freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
endif
but i don't understand that many people use many different thing at the position "NEREVAR_PROJECT" .. then i am trying to copy that and use but it's not work in my text editor . plz explain me what is it and what it means and what it does...and how it use... thanx in advance
Auto comment: topic has been updated by tanvir_cse (previous revision, new revision, compare).
Auto comment: topic has been updated by tanvir_cse (previous revision, new revision, compare).
People who prefer locally to use freopen always amaze me. This is so much less convenient than typical "./A < A1.in". To solve your problem read about compilation flags.
Works only for linux :)
Works perfectly fine on Windows as well.
Yeah, you really using Windows console? Only if you using something like Far.
I personally like using freopen locally, especially when debugging on some small sample. I keep adding debug prints and compiling every few seconds, so I like tapping F9 to compile&run and having the input automatically in there.
Guess it depends on, where/how you like to program.
If you are on some IDE & similar, it -indeed- is much more comfortable to use "freopen" {imho}
Anyway if one prefers terminal, you can do (at least in Linux) aliases (or shortcuts), which make this process faster:
Some examples:
if "p" is executed in terminal, code is compiled and run with input from "src.txt"
if "ca" is executed in terminal, code is compiled and run with input from all files, which ends with ".in"
This might make programming faster :)
Have nice day ^_^
Hope this can help you :)
ifndef ONLINE_JUDGE