Re: [Dev-C++] what is a resource? how do I create my own headers?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Luc M. <lu...@ho...> - 2001-01-04 23:28:31
|
----- Original Message ----- From: "Ioannis Vranos" <no...@ya...> To: <dev...@li...> Sent: Thursday, January 04, 2001 10:07 AM Subject: RE: [Dev-C++] what is a resource? how do I create my own headers? > He can use the following notation so as to bbe protected from multiple > includes. > > #ifndef PINKY&THE_BRAIN > > #define PINKY&THE_BRAIN > // implementation stuff > #endif > > > Ioannis > While I do agree that this will protect agaisnt multiple _inclusion_, it will NOT protect agaisnt multiple _definition_ of a function located in a header file. The #ifdef/#endif only works for the current compile. So, if you include a header file that contains a definition in more than one translation unit (.cpp file), you will get multiple definitions of the function, which is gonna be flagged as an error by the linker. Regards, Luc Morin |