Split code into two files

I am trying try split my code into 2 files. What I want to do I split the game up so that each dungeon is in a different file. The dungeons include the shape, size, and controls.Is this possible. If so how?
closed account (zb0S216C)
Do you mean data files that hold game information, or C/C++ header files?

Wazzak
data files(.cpp) that hold the commands.
closed account (zb0S216C)
My personal suggestion be this:

Writing game data to files would be far more beneficial as it allows data modification without the need to recompile after every change.

However, if you insist on using source files, fair enough. What you could do is add multiple sub-structures to your current dungeon class and divide your information that way.

Honestly, that's the only way I can think of, without running into multiple inclusion errors. Can you be a bit more specific? Maybe that way, I can help you more.

Wazzak
I will just put in in one file. But later on in my game I will put other things in other files cause my dungeon file has 2765 lines in it. So i guess later on I will make that way but my personnel deadline is this weekend for my demo
closed account (zb0S216C)
If you're putting into one file then I suggest you follow what I said in my previous post. Adding sub-structures to a structure tends to make it more readable. For example:

1
2
3
4
5
6
7
struct Character
{
    struct _Position
    {
        float x, y, z;
    } Position;
};


Wazzak
This is my same question. I downloaded an Open Source software called Code::Blocks. Its divided into many .cpp and header files. I need to know how to combine them together to form one program.
Topic archived. No new replies allowed.