Tuesday, May 6, 2014

Syntax and common practices in different Programming Languages

[1] http://en.wikipedia.org/wiki/Include_guard



#include guard  [1]
---------------------------------------------------------------
Common way is to put 'include guard' to stop include header files twice. But when naming is conflict with other macros defined in other modules. It become an issue. So some C and C++ implementations provide a non-standard #pragma once directive; The Objective-C language (which is a superset of C) introduced an #import directive, which works exactly like #include, except that it includes each file only once, thus obviating the need for #include guards

No comments: