title: How do I print (cout) a nested structures variables
body: <p>I need to figure out how to make "<em>struct</em> snack" that is "inside <em>struct</em> candybar" be able to be outputted and I can't figure it out. I've looked all over the internet and in my textbook and can't find anything that works. 
  Also how could I make the array <em>array</em> become a dynamic <em>array</em> using <em>new?</em> Any help will be greatly appreciated. Thanks</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;math.h&gt;
  #include &lt;iomanip&gt;
  using namespace std;
  
  
  int main(){
  
  struct candybar 
  {
      char name[15];
      float weight;
      int calories;
      struct Snack
      {
          const char * name2 = "Mocha Munch";
          double weight2 = 200;
          int calories2 = 2;
      };
  };
  candybar array[3] = 
  {
      {"Kit-kat", 2.3, 250},
      {"Hershey", 2.2, 252},
      {"Snicker", 2.5, 255},
  };
  
  cout &lt;&lt; array[0].name &lt;&lt; " " &lt;&lt; array[0].weight &lt;&lt; " " &lt;&lt;  array[0].calories &lt;&lt; endl;
  cout &lt;&lt; array[1].name &lt;&lt; " " &lt;&lt; array[1].weight &lt;&lt; " " &lt;&lt; array[1].calories &lt;&lt; endl;
  cout &lt;&lt; array[2].name &lt;&lt; " " &lt;&lt; array[2].weight &lt;&lt; " " &lt;&lt; array[2].calories &lt;&lt; endl;
  return 0;
  }
  </code></pre>