Re: [Dev-C++] Organisation of header files
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <a_g...@ya...> - 2003-07-08 22:25:19
|
Hi Michael , I think the second option is the best, cause I always use it.But in that case just see to it that none of the public methods are declared n the hpp file. If you need a public method to be inline, use the inline keyoword. Moreover, in case you decide to code any of your private functions in the cpp file, again the same situation arises as when you have to mix-up the includes. In those cases the first approach looks good. The third approach does not quite appeal to me. Its just a question of good programming practice, all 3 will work equally well before the code goes through repeated maintainance cycles :-) Hope that helps, avik Michael Stather <mic...@nu...> wrote: Hi, I divide my classes in a .cpp-file and a header-file (as suggested). Now I´ve heard of 3 possibilities to organise the dependencies: 1. Include only one header file in the implementation file, and in this header file, beside the class declaration include all required headers 2. Include the header which are important for the public interface of the class in the .cpp-file, and those who are only important for the methods "inside" the class in its header file (sounds the most logical) 3. Don´t include any header-file in the class-header, but include them all in the .cpp-file (before the actual class-header) Which solution is the best? (Or perhaps a completely different solution) Thanks for your help!! ------------------------------------------------------- This SF.Net email sponsored by: Parasoft Error proof Web apps, automate testing & more. Download & eval WebKing and get a free book. www.parasoft.com/bulletproofapps _______________________________________________ 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 Thanx and Regards Avik Ghose SMS using the Yahoo! Messenger;Download latest version. |