Use of operator overloading in structure within class
<p>I have a header file where i am declaring a class with a structure within it. Also i am declaring an overloading operator(!=, to compare structures) as member of this class. I am giving the definition of this operator in the cpp file. But i am not able to access the members of the structure </p>

<p>car.h</p>

<pre><code>class car
{ 
int carsor;

struct model
{
    int id;

    int mode;

}prev,curr;

bool operator !=(const model&amp; model1);

};
</code></pre>

<p>car.cpp</p>

<pre><code>#include "car.h"

bool car::operator !=(const model&amp; model1)
{
if((model1.id==model.id)&amp;&amp;(model1.mode==model.mode))
{
    return false;
}

else
{

    return false;
}
}
</code></pre>

<p>The error i get is this </p>

<pre><code>Error   2   error C2275: 'car::model' : illegal use of this type as an expression   
</code></pre>

<p>how should i access the the structure members? </p>
