Dev-C++ includes

Started by
10 comments, last by nagromo 20 years, 4 months ago
There a post recently about C''s #include system sucking. This is why.

For each class, have one .cpp file and one .h (or .hpp) file. Put the class definition in the .h and the implementaion in the .cpp. Then, only inlcude the .h files where thay are needed. Don''t put everything in one header file.

Read this article for a better explanation.

There a some things I like about Java, and some things I hate, but the modules are what I like most.
Advertisement
If someone is gonna do ze_jackal''s call, they might as well make a new header for related stuff. For example:
//3DObject definitions#ifndef OBJECT3D_H#define OBJECT3D_H//--------------------------------------#include CObject.h#include CSprite.h#include C3DSModel.h#include CMD2Model.h#include CMD3Model.h//etc...//--------------------------------------#endif

This way, you could have groups of headers. Nice little touch imo.

This topic is closed to new replies.

Advertisement