Archived

This topic is now archived and is closed to further replies.

Multiple cpp Files?

This topic is 6492 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey all, I am trying to make a text based RPG. Now I do not want to have all the code in one large cpp file because it would be to hard to maintain and it would be pron to lots of errors. So I was wondering how i can use multiple cpp files in one exe. So can anyone help me with this?? Thanx node_5

Share this post


Link to post
Share on other sites
Basically you just add more than one *.cpp file to your project and prototype all of your functions in the header file so all of the *.cpp files can access the functions.

You also need to define all of your data structures and such in your header file.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You might also try adding the keyword ''extern'' to all your global variables.

Share this post


Link to post
Share on other sites