When coding in either C or C++, where should I have the #include
\'s?
callback.h:
#ifndef _CALLBACK_H_
#define _CALLBACK_H_
#include <
If I #include
, I don't want to have to #include
lots of other header files to get my code to compile. In callback.h
you should include everything needed to compile against it. But nothing more.
Consider whether using forward declarations in your header file (such as class GtkButton;
) will suffice, allowing you to reduce the number of #include
directives in the header (and, in turn, my compilation time and complexity).