Creating arrays from user input c++
<p>I want to create an array from user input. The user input will look like this:</p>

<pre><code>ID     Numbers
1 -3 2 -1 12 19 8
2  3 1 -3 2 19 5
3  7 4 1 7 9 3
4  9 12 4 6 -7 4
</code></pre>

<p>So there is an ID and then 6 numbers after that. I could have up to 20 IDs. At first I had something like</p>

<pre><code>struct Prog 
{
    unsigned int ID;
    signed int num_1;
    signed int num_2;
    signed int num_3;
    signed int num_4;
    signed int num_5;
    signed int num_6;
};
</code></pre>

<p>And I read in the data files as input in a separate function from the terminal using this:</p>

<pre><code>for (;;)
{
cin &gt;&gt; Temp.ID &gt;&gt; Temp.num_1 &gt;&gt; Temp.num_2 &gt;&gt; Temp.num_3 &gt;&gt; Temp.num_4 &gt;&gt; Temp.num_5 &gt;&gt; Temp.num_6;
}
</code></pre>

<p>However, the problem is, when I try to find the min/max values of these IDs/Arrays, it became very confusing with that many different arrays and elements.</p>

<p>So now what I want to do is something like this:</p>

<pre><code>struct Prog 
{
    unsigned int ID;
    static const int num_elements = 6;
    signed int numbers[num_elements];

};
</code></pre>

<p>And then later on I can find the min/max value easier by doing 1 for loop and comparing the values using 1 if statement instead of many as would be in my previous example.</p>

<p>My problem is, I am not sure how to take the above new Struct and read the data file at the top given and store them in the program to run operations on them. Any help would be appreciated.</p>

<p>Thanks.</p>

<p>EDIT: Without using vector from std or min/max from std.</p>
