title: How to allocate memory to array of character pointers?
body: <p>I want to allocate memory to the following array of char pointers:</p>
  
  <pre><code>char *arr[5] =
      {
          "abc",
          "def",
          "ghi",
          "jkl"
      };
  
      for (int i = 0; i &lt; 4; i++)
          std::cout &lt;&lt; "\nprinting arr: " &lt;&lt; arr[i];
  </code></pre>
  
  <p>Following does not work:</p>
  
  <pre><code>char *dynamic_arr[5] = new char[5];
  </code></pre>
  
  <p>What is the way to allocate memory for an array of strings?</p>