Thread: Question about #ifndef
should every c header file include:
also, should put function prototypes , other header files in between also, instance:code:#ifndef __header_h__ #define __header_h__ #endif
or should function prototypes go outside of #endif? confused, help.code:#ifndef __header_h__ #define __header_h__ #include <math.h> int addition (int x, int y); #endif
it's - preprocessor facilities of c/c++ (and other languages) powerful tool that, if used well, make life lot easier.
1 reason i'd second example, declarations in #ifndef/#endndef block make sure 1 particular set of declarations once during compilation of particular file.
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Question about #ifndef
Ubuntu
Comments
Post a Comment