How to properly use mutliple source files in this?

I have a text based game I'm working on. I've gotten the first part done where you simply enter in your info, Race, Class, Name, gender, etc. I don't want to put any more code into this file however. What is the proper way to continue on to new files?
Save your other code into a separate cpp file, and make sure you don't include another main function in the auxiliaries. Next, create a header file, a file that has extension "h." In your header file, put all of the function prototypes you will be calling across source files and enter which global variables you will be passing among source files. To do this, type "extern" followed by your variable type and its name. You do not need to type in the include directives as in your source files.

Finally, in each source file, use the preprocessor directive "#include" and your header file in quotation marks. When compiling, your compiler will be able to look up your header file with prototypes and global variables to stitch your source files together.

~Daleth~
Topic archived. No new replies allowed.