title: Separating helper functions into a separate C++ header/source file
body: <p>So in my current project, I have main.cpp, fruit.h, and fruit.cpp.</p>
  
  <p>In main.cpp, it current looks like this:</p>
  
  <pre><code>#include "fruit.h"
  #include &lt;Mouth.h&gt;
  
  int main() {
    Fruit orange;
    orange.wash(); //wash is a method of the Fruit class
  
    Mouth mouth = NULL; //Mouth is a library I am using
    if(mouth_init() != 0) {
      return 1;
    }
  
    mouth = create_new_mouth();
  
    if (mouth == NULL) {
      return 1;
    }
  
    mouth_eat(orange);
  
    clean_up_mouth();
    mouth = NULL;
  }
  </code></pre>
  
  <p>Obviously this is an overly simplified example, as my actual library init and exit functions are more complex. But I was thinking of taking out the initialization and clean up code from main, and create helper functions. Now I could place these helper functions within main.cpp, but I was thinking of creating a new C++ file called mouth.cpp, and putting the functions in there. But since mouth.cpp won't have a class, and will just contain my helper functions, is this legal or even good practice to do? If it is allowed, should I create a mouth.h file containing the function declarations as well?</p>