title: Using a simple class in c++, not working?
body: <p>I found a begginers c++ challenge I wanted to try. However, the following code is saying that it contains erros when I compile it. If I try to take 1 line at a time, it exits in the first class definition at the end... I have no idea what's wrong :)</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class Polynomial {
      int a, b, c, functionValue;
  
  public:
      Polynomial (int, int, int);
      static void functionValue(Polynomial);
  };
  
  Polynomial::Polynomial (int x, int y, int z) {
      a = x;
      b = y;
      c = z;
  }
  
  void Polynomial::functionValue(Polynomial x) {
      for (int i = 0; i &lt; 5; i++) {
          x.functionValue = x.a * pow(i, 2) + x.b * i + x.c;
          cout &lt;&lt; "The value of the function for x = "
               &lt;&lt; i &lt;&lt; " is " &lt;&lt; x.functionValue;
      }
  }
  
  int main () {
      Polynomial poly (2, 3, 5);
      Polynomial::functionValue(poly);
  
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>I don't know why the formatting is so poor. Here is a <a href="http://pastebin.com/XZ7UdDvv" rel="nofollow">pastebin link.</a></p>
  
  <p>(Edit: My fault, I edited over a previous edit and accidentally removed these - BoBTFish)</p>
  
  <p>Compiler errors:</p>
  
  <pre><code>'Polynomial::functionValue' : redefinition; previous definition was 'data member' 'see declaration of 'Polynomial::functionValue'
  'Polynomial::functionValue' : not a function' 'illegal reference to non-static member 'Polynomial::functionValue'
  </code></pre>
  
  <p>Thanks in advance.</p>