Jump to content

Organizing my program

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
MerakSpielman

MerakSpielman

    Learning Programmer

  • Members
  • PipPipPip
  • 44 posts
I'm new at programming, and am pretty much self-educating myself in C++ (I'm signed up in a programming certificate course, but I haven't even gotten to the programming classes yet).

But the program I'm working on for practice is starting to get long. Too long. It takes forever to find things. I'll have classes declared up there, and function templates up THERE, and global variables over there, and my main function over there, and then all my custom functions over THERE...

It's only 400 lines long, and I know serious programs are usually MUCH larger, but it's already starting to get difficult finding my way around. I can get everything I'm adding into the program working all right, but I keep having to stop and think and make sure I put similar types of things together so I don't forget about some bit somewhere... I can't help but wonder if there's a better way to go about it.

I'm using the Bloodshed Dev-C++ compiler, and I've noticed that there are rooms for multiple tabs. How do those work? If I separate my code out into separate tabs, how do I know what order things are going to happen in?

#2
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts

"MerakSpielman" said:

[...] how do I know what order things are going to happen in?
You'll know it by the order you include other files. For including files, you shall use the #include-directive which shall be put in the top of your file, exactly like you're including iostream. Note that you cannot include source-files (.cpp), but only header-files (.hpp)