I am working on a c++ project. I want to define my own classes. I define each class in a separate header file, and define the body of its methods in another source cpp file. For example:
/
Expand|Select|Wrap|Line Numbers
- //Person.h
- class Person
- {
- // data members and methods.
- };
- //Person.cpp
- #include "Person.h"
- //define the body of the methods here.
I put all header files in a structure like this:
-include
-humans
-employees
-students
and created another structure for source cpp files like this:
-humans
-employees
-students
The problem is that I have to provide the relative path of the file I want to include. For example, if I want to include Pupil.h in the source file Pupil.cpp :
Expand|Select|Wrap|Line Numbers
- #include "../../include/humans/students.Pupil.h";
I guess using namespaces could help, right ?
Any ideas?
Thanks,