title: Declaring pointer to an integer array C++
body: <p>I want to declare a pointer to an integer array in the header file for my class. I have</p>
  
  <pre><code>private:
   int *theName;
  </code></pre>
  
  <p>and then in the constructor</p>
  
  <pre><code>theName = new int[10];
  </code></pre>
  
  <p>will this work? Is there another way to do this so you have a pointer to an array?</p>
  
  <p>I thought int *theName created a pointer to an integer not an integer array, if this creates a pointer to an integer array how do you create a pointer to just an integer?</p>
  
  <p>Also in the destructor can I call</p>
  
  <pre><code>delete theName; theName = NULL;
  </code></pre>
  
  <p>Will that delete theName integer array object and then point theName to null in memory?</p>
  
  <p>Thanks</p>