enter values in structure using vectors
<p>I have created this structure:</p>

<pre><code>struct xlsmain {
    vector&lt;sub_parts&gt; sb;
    string name;        
}

struct sub_parts {
    vector&lt;pio_parts&gt; pio;
    string name_pio;
    string direction;
    string partition;
}

struct pio_parts {
    string pio_name;
    vector&lt;report_specs&gt; report;
}

struct report_specs {
    string name; 
    vector&lt;string&gt; value;
}

struct xlsmain* interface = new xlsmain[100];
</code></pre>

<p>The nesting is necessary because every element is related in a heirarchial manner.  The problem I am facing right now is how to enter values in this structure.</p>

<p><strong>EDIT:</strong> I don't like using <code>push_back()</code> because every time I'll have to declare a separate structure.  So for instance if I want to add a sub part to xlsmain, I have to declare a variable:</p>

<pre><code>sub_parts sb1;
</code></pre>

<p>Then I have to feed values into this structure until it is finished, when I can use:</p>

<pre><code>interface[i].sb.push_back(sb1);
</code></pre>

<p>Further, if nesting is involved then a number of structures like <code>sb1</code> will also have to be created.  This leads to having to create a large number of variables just to enter even a single value in my structure.</p>
