title: C++ convert strings to char arrays
body: <p>I want to have 2 strings as input so I can use <code>getline(cin,s)</code> (so I can pick the whole line until <code>'\n'</code>) and then I want to search the second array if it contains the word of the first array without using <code>string::find()</code> or <code>strstr()</code>.
  But I still can't find a way to either convert strings to arrays</p>
  
  <pre><code>int main()
  {
      string s;
      string s2;
      char array[50];
      char array2[50];
  
      cout&lt;&lt;"Give me the first word"&lt;&lt;endl;
      getline(cin,s);
  
      cout&lt;&lt;"Give me the text"&lt;&lt;endl;
      getline(cin.s2);
  
      array=s;
      array2=s2;
  }
  </code></pre>
  
  <p>The second way I was thinking was doing the job from the start with arrays:</p>
  
  <pre><code>char array[50];
  cin.getline(array,50);
  </code></pre>
  
  <p>But if I use straight arrays is there any way I can find the length of the array like we do on strings? </p>
  
  <pre><code>//example
  string s;
  int x;
  
  getline(cin,s);
  x=line.length();
  </code></pre>