C++ - Namespace vs. Static Functions
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1434937/namespace-functions-versus-static-methods-on-a-class">Namespace + functions versus static methods on a class</a>  </p>
</blockquote>



<p>I want to group similar functions togther.  I can do it one of two ways.  To me they are just syntactical differences...in the end it does not matter.  Is this view accurate?</p>

<p>Namespace:</p>

<pre><code>namespace util
  {
  void print_array(int array[])
    {
    int count = sizeof( array ) / sizeof( array[0] );
    for (int i = 0; i &lt;= count; i++) cout &lt;&lt; array[i];
    }
  }
</code></pre>

<p>Class:  </p>

<pre><code>class Util
  {
  public:
    static void print_array(int array[])
      {
      int count = sizeof(array);
      for (int i = 0; i &lt;= count; i++) cout &lt;&lt; array[i];
      }
  };
</code></pre>

<p>Call with </p>

<pre><code>Util::print_array()  // Class
</code></pre>

<p>or </p>

<pre><code>util::print_array()  // Namespace
</code></pre>
