Re: [Dev-C++] Where to include files
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Matthews <dem...@uw...> - 2003-10-12 15:24:03
|
Guard statements are lines like these in your header files: #ifndef FOOHEADER_H #define FOOHEADER_H int foo; char *foostring; //... #endif Then if two files include foo.h, it won't be recompiled because FOOHEADER_H has already been defined. At 04:12 PM 11/10/2003 -0700, David McKen wrote: >Explain. > >----- Original Message ----- >From: <age...@co...> >To: <ci...@ya...> >Sent: Saturday, October 11, 2003 12:12 PM >Subject: Re: [Dev-C++] Where to include files > > >> Guard statements can prevent this. >> >> -- >> ~~Scott Simontis~~ >> Programmer >> > As far as I know there are no "rules". However here is my rule >> > "Include in >> > the .cpp, if it gives you errors put it in the .h". >> > >> > The main reason you don't want to put it in the .h is because the >> > header >> > will be included in EVERY single file that includes your header >and >> > (this is >> > the killer) is recompiled every time one of those files is >> > re-compiled. If >> > the header is in the .cpp then it is only re-compiled when the >.cpp >> > changes. >> > >> > Of course if you have some super computer avalible then this >reason >> > goes out >> > the window. If you don't then this is about the only reason I can >> > think of. >> > >> > Signed >> > David McKen >> > >> > >> > ----- Original Message ----- >> > From: "Glen Vermeylen" <gve...@pa...> >> > To: <dev...@li...> >> > Sent: Saturday, October 11, 2003 10:32 AM >> > Subject: [Dev-C++] Where to include files >> > >> > >> > > Hi, I was wondering where I should best place my include files. >> > > Suppose I have a class testClass which needs to include a >couple of >> > files. >> > > Should I place the include-statements in the .cpp files or in >the >> > .h (so >> > > one could see which files are needed?)? >> > > Or does it depend on the circomstances? For example: >include-files >> > which >> > > contain the type of declared members in the header, and >> > include-files >> > > needed for the implementation in the .cpp file? >> > > Are there rules, or am I free to choose? >> > > >> > > Please enlighten me :-) . >> > > >> > > >> > > >> > > ------------------------------------------------------- >> > > This SF.net email is sponsored by: SF.net Giveback Program. >> > > SourceForge.net hosts over 70,000 Open Source Projects. >> > > See the people who have HELPED US provide better services: >> > > Click here: http://sourceforge.net/supporters.php >> > > _______________________________________________ >> > > Dev-cpp-users mailing list >> > > Dev...@li... >> > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >> > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >> > >> > >> > __________________________________ >> > Do you Yahoo!? >> > The New Yahoo! Shopping - with improved product search >> > http://shopping.yahoo.com >> > >> > >> > ------------------------------------------------------- >> > This SF.net email is sponsored by: SF.net Giveback Program. >> > SourceForge.net hosts over 70,000 Open Source Projects. >> > See the people who have HELPED US provide better services: >> > Click here: http://sourceforge.net/supporters.php >> > _______________________________________________ >> > Dev-cpp-users mailing list >> > Dev...@li... >> > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > >__________________________________ >Do you Yahoo!? >The New Yahoo! Shopping - with improved product search >http://shopping.yahoo.com > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program. >SourceForge.net hosts over 70,000 Open Source Projects. >See the people who have HELPED US provide better services: >Click here: http://sourceforge.net/supporters.php >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |