Saturday, April 23, 2011

#pragma once and include guards

Both work the same way. "#pragma once" seems simpler and less lines to type.
But pragmas are machine- or operating system-specific by definition, and are usually different for every compiler. So if the code need to be portable, use the include guards.

No comments:

Post a Comment