This macro: #ifndef ONLINE_JUDGE not working

This macro:

freopen(“a.txt”, “r” , stdin);
freopen(“a.out”, “w”, stdout);

is not working in this code:
Please tell me why and how will it work now?
I am working on Ubuntu 12.04 platform, will this macro only work for online compilers?

How to put more than one tag?

Okay i am sorry that was my mistake…!!

Check this code this will work:

Use and not a.txt

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

When I compile it on Ubuntu 12.04 platform, it is not taking inputs?

it works on codeblocks in windows…!! dont know why is this not working in ubuntu!!

Okay then try to implement second answer mentioned on this link: