Comparing values inside of a struct in an if statement
<p>I'm writing a fraction simplifier in C++. I am trying to compare two values in a struct to see which one is bigger, neither of the following work:</p>

<pre><code>void simplify(struct Fraction* fraction) {
    if (fraction-&gt;numerator) &gt; (fraction-&gt;denominator)
    {
        cout &lt;&lt; "test";
    }
}

void simplify(struct Fraction* fraction) {
    if (fraction.numerator) &gt; (fraction.denominator)
    {
        cout &lt;&lt; "test";
    }
}
</code></pre>

<p>Struct:</p>

<pre><code>struct Fraction {
    int numerator;
    int denominator;
};
</code></pre>

<p>errors:</p>

<pre><code>w2.cpp: In function void simplify(Fraction*):
w2.cpp:40:15: error: request for member numerator in fraction, which is of non-class type Fraction*
w2.cpp:40:26: error: expected primary-expression before &gt; token
w2.cpp:40:38: error: request for member denominator in fraction, which is of non-class type Fraction*
w2.cpp:41:2: error: expected ; before { token
</code></pre>

<p>How could I compare the values inside of a struct?</p>
