title: Calling a void function on a c++ class
body: <p>I have a function on a class in C++ that is supposed to modify the member variables in an object in that class.  The function is required to have this signature: </p>
  
  <pre><code>void normalize()
  { 
      int&amp; a = numerator;
      int&amp; b = denominator;
      int modifier = Euclid(a, b); //euclidean algorithm
      if (modifier &lt; 0) { modifier = modifier * -1; }
      a = a / modifier;
      b = b / modifier;
  }
  
  Rational temp(16, 84);
  Rational temp2 = temp.normalize();
  </code></pre>
  
  <p>When called like this I am told that there is no constructor that can convert from void to Rational. </p>
  
  <p>The function itself worked when implemented not as a "void."</p>
  
  <p>I need to call this function on other objects, how do I do that when it cannot take an input, or yield an output? I.e. object.normalize() yields an error.</p>
  
  <p>Edit: A solution was found, I just needed to implement it as <code>object.normalize()</code> without trying to do any assignment.</p>