cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Do I need a source file for each of my h
Do I need a source file for each of my header files?
Sep 3, 2012 at 5:23pm UTC
georgep
(158)
I've got a simple class that doesn't need a specific constructor or any functions, any need to make a source file?
Sep 3, 2012 at 5:46pm UTC
wohtp
(11)
One word answer: no.
Longer answer:
The
#include
statement tells the preprocessor to insert a verbatim copy of the header file into your code. So this is equivalent to having your class defined in the main .cpp file.
Topic archived. No new replies allowed.