Hello, [EMAIL PROTECTED] wrote:
> I have two files and the contents are as follows : > > file :: main.h > ------------------------------------- > #define main > -------------------------------------- > file :: main.cpp > ------------------------------------- > #include "main.h" > > int main(void) > May somebody please shed some light on this ? Everything with those # at the beginning of the line is handled by the preprocessor before the actual compiler gets its input. That preprocessor is basically able to replace identifiers by arbitrary strings. So #define main will send every identifier "main" to the empty string. A macro named main with empty value has been defined. You can see the result with g++ -E main.cc and then you will understand the compiler error message. Try the following: #define main foobar or even: #define main(x) main(int argc) I think the textbooks on C++ explain the preprocessor as far as necessary, because there is no way around in any real-world project. Bernd Strieder _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus