title: C++ Faster char array compare
body: <hr />
  <p>What I am trying to do is to find a faster way to do the same program but execute faster.</p>
  <pre><code>#include &lt;cstdio&gt;
  #include &lt;cstring&gt;
  int main ()
  
      {
          int br=0, c, n, b, e, i, q, g;
          char t[7000], a[7000];
          scanf(&quot;%d&quot; ,&amp;n);
          for (g=0; g&lt;n; g++)  // number of test cases
          {
              scanf (&quot;%7000s&quot;,&amp;t);
              c=strlen(t);
              scanf (&quot;%7000s&quot;,&amp;a);
              b=strlen(a);
              for (i=0; i&lt;b; i++)  // comparing them
              {
                  for (q=0; q&lt;c; q++)
                  {
                      if (a[i]==t[q] &amp;&amp; a[i]!='\0' &amp;&amp; t[q]!='\0')
                      {
                      br++;a[i]='\0';t[q]='\0';
                      }
                  }
              }
              printf(&quot;%d \n&quot;, br);
              br=0;
          }
          return 0;
      }  
  </code></pre>
  <hr />
  <h1>The program itself does this:</h1>
  <p>1st input: Number of test cases<br />
  2nd: You must input A array and B array for every test case<br />
  the program must check if there are any common letters from B to match with A and if there   are, to output how much they are.</p>
  <pre><code>Example input: 
  2
  qwerty
  abc
  abcde
  bcex
  Output: 
  0
  3
  </code></pre>
  <p>What I need is to make it run faster.
  Any help is apreciated. :)</p>