title: Multi-Dimensional Array ( C++ )
body: <p>I'm trying to store a pointer in an array.</p>
  
  <p>My pointer to a pointer is class object is:</p>
  
  <pre><code>classType **ClassObject;
  </code></pre>
  
  <p>So i know i can allocate it by using the new operator like this:</p>
  
  <pre><code>ClassObject = new *classType[ 100 ] = {};
  </code></pre>
  
  <p>I'm reading a text file, with punctuation and here is what i have so far:</p>
  
  <pre><code>// included libraries
  // main function
  // defined varaibles
  
  classType **ClassObject; // global object
  const int NELEMENTS = 100; // global index
  
  
  wrdCount = 1;  // start this at 1 for the 1st word
  while ( !inFile.eof() )  
  {
     getline( inFile, str, '\n' );  // read all data into a string varaible
     str = removePunct(str);  // User Defined Function to remove all punctuation.
     for ( unsigned x = 0; x &lt; str.length(); x++ )
     {
         if ( str[x] == ' ' ) 
         {
            wrdCount++;  // Incrementing at each space
            ClassObject[x] = new *classType[x];
         // What i want to do here is allocate space for each word read from the file.
  
         }
     }
  }
  // this function just replaces all punctionation with a space
  string removePunct(string &amp;str) 
  { 
      for ( unsigned x = 0; x &lt; str.length(); x++ )
          if ( ispunct( str[x] ) )
              str[x] = ' ';
    return str;
  }
  
  // Thats about it.
  </code></pre>
  
  <p>I guess my questions are:</p>
  
  <ul>
  <li>Have I allocated space for each word in the file?</li>
  <li>How would i store a pointer in the ClassObject array within my while/for loop?</li>
  </ul>