# Organizing C/C++ code

**URL:** <https://forum.kirupa.com/t/organizing-c-c-code/222502>\
**Category:** programming\
**Created:** [April 14, 2007, 12:11am UTC](https://forum.kirupa.com/t/organizing-c-c-code/222502 "2007-04-14T00:11:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Al6200](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Al6200](https://forum.kirupa.com/u/Al6200)\
**Post date:** [April 14, 2007, 12:11am UTC](https://forum.kirupa.com/t/organizing-c-c-code/222502/1 "2007-04-14T00:11:17Z")

</div>

How do you guys like to organize your C++ code? What I usually do is create a single .cpp file with my main loop, and then put all my support functions (graphics, keyboard, etc. ) in headers. But I’ve found that this often leads to confusion when two headers need to access one header, and I want to avoid headers being accessed twice.

How do you organize your C++ code? What methods have you found to be effective?
