When you include a *.h file it is pretty much the same thing as including all of the code in that #include at the start of your *.cpp file.
Remove these lines from your main.cpp to make your code work:
1 2
int dick = 30;
staticint harry = 300;
Alternatively, use extern in front of dick and harry in the .cpp file and remove the static keywords.
For a better solution follow these steps:
1. Remove all current definitions of tom, dick and harry from the .h and .cpp files.
2. Define tom, dick and harry in the main() function.
3. Pass tom, dick and harry into remote_access() as arguments.