I am working with big c++ book. I don't understand where ccc_empl.h is |
In the book? A quick websearch with that filename hints that it is used in several examples of the book. If so, it is either printed in the book or included with the book.
MSVS is an IDE. IDE's tend to have concept "project" and allow one to create new or add existing file to projects. How an IDE is used is beyond my comprehension, but I presume they have documentation.
Visual Studio 2010 is getting old, because newer versions are available without charge and have more features and language support too.
Style notes on the code that you do show:
department.h:
* Replace line 5 with
class Employee;
A forward declaration is enough, because the header does not need more information.
* Replace line 7 with
using std::string;
There is no reason to expose the entire std here.
department.cpp:
* Add
#include "ccc_empl.h"
for this source has to know the Employee.
* Replace line 5 with
1 2
|
using std::string;
using std::cout;
|
* Constructors can and should use
initializer list:
1 2 3 4
|
Department::Department(string n)
: name(n), receptionist(NULL), secretary(NULL)
{
}
|
test.cpp:
* Remove lines 1, 2, 8. None of those are used in this file.