Class function error C++
<p>I have 3 classes, lets say ClassA, ClassB and Validator.  I want to pass one variable of both classA and classB to the Validator, which will compare the values, and return a string result.  I get the following error: error: </p>

<p>request for member ‘compareValues’ in ‘validatorObject’, which is of non-class type ‘Validator*’</p>

<p><strong>main.cpp</strong></p>

<pre><code>cout &lt;&lt; classAobject.compareValues(computer1-&gt;getValue(), classBobject-&gt;getValue());
</code></pre>

<p><strong>validator.cpp</strong></p>

<pre><code>string Validator::compareValues(string classAvalue, string classBValue) {
if (classAvalue == "R") {
    if (classBvalue == "R") {
        return "Equal";
    }
}
// More will go in this function - just want to get it working first
</code></pre>

<p>}</p>

<p><strong>validator.h</strong></p>

<pre><code>string compareValues(string classAvalue, string classBValue);
</code></pre>
