count objects in a loop
<p>Here is what I wrote:</p>

<pre><code>#include &lt;iostream&gt; 
using namespace std; 

struct vetura{
    char ngjyra[10];
    char tipi[10];
};

int main(){
    int i,j;
    vetura v[4];

    for(i=0;i&lt;4;i++){
        cout &lt;&lt; "Ngjyra:"&lt;&lt;endl;
        cin &gt;&gt; v[i].ngjyra;
        cout &lt;&lt; "tipi:"&lt;&lt;endl;
        cin &gt;&gt; v[i].tipi;
    }
    j=0;
    for(i=0;i&lt;4;i++){
        if(v[i].ngjyra == "kuqe" &amp;&amp; v[i].tipi == "passat")
        j+1;
    }
    cout&lt;&lt;"kemi "&lt;&lt;j&lt;&lt;" vetura passat me ngjyre te kuqe";


    cin.get();cin.get();
    return 0;
}
</code></pre>

<p>I need to count how many times I have wrote "kuqe" for v[i].ngjyra and "passat" for v[i].tipi together. I thought the variable j is going to get bigger everytime it counts but it is not working and I am going to have an exam in the following hours can anyone help me?</p>
