When dealing with larger programs and your starting from scratch should you split classes using headers and the .cpp files from the very beginning? I am looking for a suggestion because I find 200-300 lines all on one file really annoying to scroll up and down or even when its split using the tool.

Recommended Answers

All 2 Replies

You've hit the nail on the head. You'd want structure in your programs, especially if it's a big one.

In addition, separating the files keeps functions that are related confined to one area. Keep it simple.

I kinda figured this was the case but I just came across another thing... what if your dealing with several classes but as your developing your code "you seem to forget some of the functions required for the class" <-- i was about to post this and i still will as I just realized your classes pop up after you scope resolution, silly me.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.