Compare colour values OpenGL & C++
<p>I am working on a tetris type game using OpenGL and C++ where if you match 3 tiles in a row of the same color, they disappear. Right now I'm working on the function which recognizes if there are 3 of the same color in a row. I am creating an <code>Array</code> which gets the colors of each grid, and determines if there are 3 matching colors. </p>

<p>I am having problems with comparing the colors in each array. For some reason, <code>(rowcolours[j]) == rowcolours[j+1])</code> always turns up false when the values are the same. </p>

<pre><code>//Global variable
vec4 boardcolours[1200];

//---------------------------------------

void check3match()
{
    vec4 rowcolours[10]; // initializes array to be filled

    for (int i = 0; i &lt; 10; i++)
    {
        rowcolours[i] = boardcolours[(6*i)+1]; // fill array with color values
        //visual aid to determine if values are equal. This shows up.
        cout &lt;&lt; "Row" &lt;&lt;  i+1 &lt;&lt;" : " &lt;&lt; rowcolours[i] &lt;&lt; " - " &lt;&lt; boardcolours[(6*i)+1] &lt;&lt; endl;
    }

    for (int j = 0; j &lt; 8; j++)
    {
        if ((rowcolours[j]) == rowcolours[j+1]) &amp;&amp; (rowcolours[j+1] == rowcolours[j+2]))
        {
            // another visual aid, I'm not seeing this :(
            cout &lt;&lt; "Row" &lt;&lt; j+1 &lt;&lt; " = " &lt;&lt; j+2&lt;&lt; " = " &lt;&lt; j+3 &lt;&lt; endl;
        }
    }

}
</code></pre>

<p>Sample output:
    Row 1: ( 0, 1, 0, 1)
    Row 2: ( 0, 1, 0, 1)
    Row 3: ( 0, 1, 0, 1)
    Row 4: ( 1, 1, 0, 1)
    Row 5:  ...</p>

<p>I'm very confused as to why this is not working. Am I using the wrong comparison operator? I am new to both C++ and OpenGL, and do not know how else to compare the two arrays. Thank you very much in advance.</p>