Sign in to follow this  

Multiple source files for one header in VC++?

This topic is 3297 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

Not sure if this is in the right place, but I'm writing a sprite class for SDL atm and it's turning out to have LOADS of code. It just all looks wrong inside one source file. So, I was wondering, can i split it between multiple source files, and if so, how? Will it just do all the function definitions anyway no matter what my source file is called as long as I include the header?

Share this post


Link to post
Share on other sites
Quote:
Original post by Element of Power
Not sure if this is in the right place, but I'm writing a sprite class for SDL atm and it's turning out to have LOADS of code. It just all looks wrong inside one source file. So, I was wondering, can i split it between multiple source files, and if so, how? Will it just do all the function definitions anyway no matter what my source file is called as long as I include the header?


Basically yes, having a "Something.h/cpp" pair is pure convention, it doesnt need to be that way.

Share this post


Link to post
Share on other sites
Quote:
Original post by Element of Power
Not sure if this is in the right place, but I'm writing a sprite class for SDL atm and it's turning out to have LOADS of code. It just all looks wrong inside one source file. So, I was wondering, can i split it between multiple source files, and if so, how? Will it just do all the function definitions anyway no matter what my source file is called as long as I include the header?


'LOADS' of code implies 'LOADS' of functionality.

What does a sprite do, conceptually? Now, go through the list of member functions, and justify whether they actually belong as part of a Sprite.

Share this post


Link to post
Share on other sites

This topic is 3297 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this