title: Declaring and allocating memory for a double pointer (char**)
body: <p>I have a program that requires me to read in large amount of data into a array of strings, and there is a set part of the initial function to declare all variables. The problem is i do not know the actual size of the array of strings until later in the function, so instead of declaring it down below the line that finds the length of the array; I would like to define the variable above then allocate memory after the line. My thinking is:</p>
  
  <p>Ideal:</p>
  
  <pre><code>int declaration;
  Char ** DataArray;  //initial declaration at top of file
  char * usage;
  int Buffer;
  
  //function continues.....
  
  Buffer = SomeNum; //find length of array needed
  
  //allocate ideal size of array(HOW?)
  </code></pre>
  
  <p>What i am currently doing:</p>
  
  <pre><code>int declaration; //not placing the declaration here, bad programming practice especially
  char * usage;    //considering this is an open source project i am working on.
  int Buffer;
  
  //function continues.....
  
  Buffer = SomeNum;
  char * DataArray[Buffer]; //works, but NOT ideal!
  </code></pre>