title: How to check if string is in array of strings
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  bool in_array(string value, string *array)
  {
      int size = (*array).size();
      for (int i = 0; i &lt; size; i++)
      {
          if (value == array[i])
          {
              return true;
          }
      }
  
      return false;
  }
  
  int main() {
      string tab[2] = {"sdasd", "sdsdasd"};
      string n;
      cin &gt;&gt; n;
      if (in_array(n, tab)) {
  
      }
      return 0;
  }
  </code></pre>
  
  <p>I want to check in C++ if <strong>n</strong> string is in <strong>tab</strong> array, but the code return an error. 
  What I am doing wrong? Maybe I should use the vectors?</p>