But how can I declare the doubles x, y, and z so that they can be used in all the seperate files? When I include them in either header.cpp or header.h I'm not able to use them in main again, and when I include them in main, it says they're undefined in the other two files. If I were to include them all in each file, it creates an error having to do with multiple definitions of x, y, and z.