Hi Richard,
Welcom to developerfusion! 
=> About your code :
- You don't need to include 'stdlib.h', just enough to include 'cstdlib', since it's the newer version of 'stdlib.h'. But it's not a problem.
- The problem is : you should include 'string' in 'safestuff.h', then add the following lines at the first of 'safestuff.h' :
#include <string>
using namespace std;
Please note that, you should include all of required header files in each separate file of your project.