title: C++ check if element exists in array
body: <p>I've found a lot of topics like this, but it was kinda too complicated for me. </p>
  
  <p>How to check if element exists in an array?</p>
  
  <p>first I declare an array and put values in it</p>
  
  <pre><code>for(int l=0;l&lt;=21;l++){
          skirt[l]=l;
      }
  </code></pre>
  
  <p>and then with another <code>for</code> I'd like to check if any element which exist in other array is in array <code>skirt[];</code></p>
  
  <p>Is there a way to write it something like this?</p>
  
  <pre><code>for(int k=0;k&lt;=n;k++){
      if(skaiciai[k]!=skirt[k]){
          counter++;
      }
  }
  </code></pre>