bus error caused by print statement
<p>Ok so I have simple function that returns the highest non-pair card from a 5 card poker hand.  But he problem I'm having is wierd.  There is this random bus error that occurs randomly, and I don't know for what reason. I thought it was the print statements I was using but now I'm not sure.  I know it looks a mess, but if you look at the line below where I print the words "test print", can someone tell me why immediately after this line theres a bus error and it doesn't get to the second "test print" statement.  Could I have run out of memory for my program???  That probably makes no sense, but I can't really think of anything else (please exclude the slightly confusing code):</p>

<pre><code>int Hand::highestNonPair(int *face_array_exclude, int size)
{
    int highest = 0;
    int contains_excludable = 0;
    int i = 0;

    if(this-&gt;hasAnother(i) == false)
            highest = cards[i]-&gt;getFace();


    for(i= 0;i&lt;cards.size();i++)
    {
        if((cards[i+1]-&gt;getFace() &gt; cards[i]-&gt;getFace()) &amp;&amp;
        (this-&gt;hasAnother(i) == false)){
            if(size&gt;0){
                for(int c = 0;c&lt;size;c++){
                    if(cards[i]-&gt;getFace() == face_array_exclude[c])
                            contains_excludable = 1;
                    }
             }

                 if(!contains_excludable)
            highest = cards[i+1]-&gt;getFace();

        cout&lt;&lt;\nTEST PRINT"&lt;&lt;endl;
        contains_excludable = 0;
        cout&lt;&lt;\nTEST PRINT"&lt;&lt;endl;
        }
    }

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