Where to put utility functions
<p>I have <code>program.cpp</code> which contains <code>main</code> function. There is a class <code>Tracker</code> which is used in the <code>main</code> function. <code>program.cpp</code> also contains a bunch of utility functions (a function to check if the file passed as an argument to the program exists for example). I want to move these utility functions out of <code>program.cpp</code>. How should I do this:</p>

<ul>
<li>make <code>utils.cpp</code> containing the functions as they are, put the prototypes into <code>utils.h</code>, include <code>utils.h</code> inside <code>program.cpp</code> and compile as <code>g++ ... program.cpp utils.cpp</code></li>
<li>or, make <code>utils.h</code> a class with no private members, just have all the functions as public, implement them in <code>utils.cpp</code> and then use them in <code>program.cpp</code> as <code>Utils utils; utils.stuff(...);</code></li>
</ul>
