ISO C++ forbids comparison between pointer and integer [-fpermissive]| [c++]
<p>I am trying to compile the following code on Ubuntu (64-bit), with Code::Blocks 10.05 as IDE:</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;
int main() {
    char a[2];
    cout &lt;&lt; "enter ab ";
    cin &gt;&gt; a;
    if (a == 'ab') // line 7
    {
         cout &lt;&lt; "correct";
    }
    return 0;
}
</code></pre>

<p>On line 7, my compiler gives me the error "ISO C++ forbids comparison between pointer and integer [-fpermissive]".</p>

<p>Why doesn't this work?  I know I could use an <code>std::string</code> to work around the problem, but I want to understand the current problem.</p>
