Questions about .cpp and .h files

Ok so i have a large program and lets say i want to split it up into different parts to make it neater and easier to navigate, how would i use 2 .cpp files in the same project? i tried it before and i had problems doing it. I know .h files are for classes, structs, etc and .cpp files are for code that will never get shared but my code is 765 lines long and its hard to edit and maintain when its in one huge file, and its only going to get bigger so how do i use stuff in one .cpp file in another?
I would image of you just add the new cpp file into the project, include the appropriate header the compiler will find it.

Why would you want to do this?
because my code is huge see

the only things i have in seperate files are my classes. those are in headers.
Just use multiple headers. I mean you can have any amount of .h files connected to it, and not just for classes... One could write functions inside a namespace in a header file and then add using namespace ....... to the top of the .cpp file.
Topic archived. No new replies allowed.