title: Deallocating a struct containing string variables
body: <p>I have the following struct</p>
  
  <pre><code>struct node
  {
  string name;
  bool   isDir;
  int    size;
  string data; //lets store this as a string
  timespec atime;
  timespec ctime;
  timespec mtime;
  list &lt;node*&gt; children;
  
  };
  </code></pre>
  
  <p>If I have a declare a node pointer like</p>
  
  <pre><code>node * directory = new node;
  </code></pre>
  
  <p>and then 
  populate it with values</p>
  
  <p>and then finally use</p>
  
  <pre><code>delete directory; //c++ construct
  </code></pre>
  
  <p>will all the memory space be freed? I'm particularly interested to know if the strings are automatically deallocated.</p>