title: C++ Boolean problem (comparison between two arrays)
body: <p>I have a problem to do. I already did some part of it, however I stuck and don't know exactly what to do next.</p>
  
  <p>The question: " You are given two arrays of ints, named A and B. One contains AMAXELEMENTS and the other contains BMAXELEMENTS. Write a Boolean-valued function that returns true if there is at least one point in A that is the same as a point in B, and false if there is no match between two arrays. "</p>
  
  <p>The two arrays are made up by me, I think if I know how to compare two arrays I will be fine, and I will be able to finish my problem.</p>
  
  <p>This is what I have so far (I changed AMAXELEMENTS to AMAX, and BMAXELEMENTS to BMAX):</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
      const int AMAX = 5, BMAX = 6;
      int i;
      bool c1 = true, c2 = false;
      int A[AMAX] = { 2, 4, 1, 5, 9 };
      int B[BMAX] = { 9, 12, 32, 43, 23, 11 };
  
      for (i = 0; i &lt; BMAX; i++)
          if (B[i] == A[i])       //  &lt;---- I think this part has to look
                                  //        different, but I can't figure it out.
              cout &lt;&lt; c1 &lt;&lt; endl;
          else
              cout &lt;&lt; c2 &lt;&lt; endl;
      return 0;
  }
  </code></pre>