title: Getting the Content of String into a Char Array
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  int main()
  {
  
      std::string data;
      data = "hello world";
      char string1[] = data;
  
  }
  </code></pre>
  
  <p>If I must use <code>char string1[]</code> and not <code>char *string1</code>, is there a way I can copy content of string data into this <code>char string1[]</code>?</p>
  
  <pre><code>file.cpp: In function ‘int main()’:
  file.cpp:13:22: error: initializer fails to determine size of ‘string1’
  </code></pre>