Angus Leeming <[EMAIL PROTECTED]> writes: | Once you get used to it, it'll become second nature. One especially | nice thing to do is: | | foo.h: | #ifndef FOO_H | #define FOO_H | | void myFunc(int a); | | #endif | | foo.C: | #include <config.h> | #include "foo.h" | | void myFunc(int const a) { | ... | }
Yes, I like this one too... _but_ there are compilers that do not understand this at all and sees them as two different prototypes. | Ie, you pass the int by value so it's no concern to your user what you | do with the "a". However, in the implementation, you're telling | yourself that you're not going to be modifying "a". | | And the magic is that the compiler will understand and accept your code :) at least gcc will. -- Lgb