- #36
Mark44
Mentor
- 37,788
- 10,180
I copied what you posted in post #6, with one small change (eliminated the long path on the header file), and the program worked as expected. No muss, no fuss, no gyrations.
Of course the portion with main() has to have an #include for the header file -- the header file contains declarations for the class and its methods that you are using. And of course, the implementation file needs an #include for the header file, since the implementation is providing definitions for the class methods.
In both the user of the class (with main()) and the implementation, this is all you need as declarations for the class and its methods (functions):
You really don't want that long full path you had in post #6.
Of course the portion with main() has to have an #include for the header file -- the header file contains declarations for the class and its methods that you are using. And of course, the implementation file needs an #include for the header file, since the implementation is providing definitions for the class methods.
In both the user of the class (with main()) and the implementation, this is all you need as declarations for the class and its methods (functions):
C++:
#include "Rectangle.h"