#if 0

Aug 2, 2009 at 9:15am
I found this in few .h files:
1
2
3
4
5
#if 0
#if something
#define something
#endif
#endif 

so what #if 0 does?
Aug 2, 2009 at 11:42am
Some people use it to avoid the compilation of some part of code ( something similar to commenting the code out )

1
2
3
4
5
6
7
#if 0

     cout << "This won't be compiled so you won't see this line";

#endif

cout << "This would be compiled and executed so you will see this line";
Last edited on Aug 2, 2009 at 11:42am
Topic archived. No new replies allowed.