title: Over loading * operator - must take either zero or one arguments
body: <p>I'm new to overloading operators, I did some search and found <a href="http://www.learncpp.com/cpp-tutorial/92-overloading-the-arithmetic-operators/">this helpful article</a>, I wrote my own code like the author did but I get <code>vector vector::operator*(float, vector) must take either zero or one argument</code> error.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>class vector
  {
        public:
         float x;
         float y;
  
        vector(float, float);
        float operator$ (vector, vector);
        vector operator* (float, vector);
        vector operator* (vector, float);
  };
  
  vector::vector(float _x = 0, float _y = 0)
  {
     x = _x;
     y = _y;     
  }
  const float vector::operator$ (const vector &amp;v1, const vector &amp;v2)
  {
      return (v1.x * v2.x) + (v1.y * v2.y);
  }
  
  const vector vector::operator* (const float &amp;m, const vector &amp;v)
  {
      vector ret_val = v;
      ret_val.x *= m;
      ret_val.y *= m;
      return ret_val;
  }
  
  const vector vector::operator* (const vector &amp;v, const float &amp;m)
  {
        return m * vector;     
  } 
  </code></pre>
  
  <p>My operating system is <code>kubuntu 12.04</code> and my IDE is <code>dev-C++</code> running on linux using wine windows program loader.</p>