title: Initializing a struct which is a member of another struct - ISO C++
body: <p>I have two structs:</p>
  
  <pre><code>    struct port
  {
      bool isOutput;
      bool isConnected;
      int connwires;
  };
  
  struct node
  {
      port p;
      vector&lt;Wire*&gt; w;
  };
  </code></pre>
  
  <p>And I have:</p>
  
  <pre><code>    node *nodes;
  </code></pre>
  
  <p>in my class.
  The question is how to initialize the port member (p) of all n node structs created by:</p>
  
  <pre><code>    nodes= new node[n];
  </code></pre>
  
  <p>statement in the class constructor.</p>
  
  <p>(I was defining port struct like this:</p>
  
  <pre><code>    struct port
  {
      bool isOutput=0;
      bool isConnected=0;
      int connwires=0;
  };
  </code></pre>
  
  <p>but its invalid in "ISO C++". )</p>
  
  <p>Thanks.</p>