C++ Read file in 2D array
<p>I'm almost frustrated with this program. I have a file that contains 100 records but, my output will not go beyond 17 including the header. Can anyone tell me what I am doing wrong?</p>

<pre><code>#include "stdafx.h"
#include &lt;iostream&gt;
#include &lt;fstream&gt;

using namespace std;

char medRecord[100][8];
int header, person;

int main()
{

    ifstream in("fakedata.txt");
    if(!in){
        cout &lt;&lt; "Cannot open file. \n";
        return 1;
    }

in.read((char *) &amp;medRecord, sizeof medRecord);

for(person = 0; person &lt; 100; person++)
     for(header = 0; header &lt; 8; header++)
cout &lt;&lt; medRecord[person][header] &lt;&lt; "";

return 0;

}
</code></pre>

<p>Output:</p>

<pre><code>Number,Gender,GivenName,Surname,Birthday,BloodType,Pounds,FeetInches
1,male,Joseph,Doody,1/10/1968,A-,179.5,5' 7"
2,male,Robert,King,8/17/1985,A+,203.1,5' 10"
3,male,Richard,Murphy,3/18/1944,O+,235.6,6' 1"
4,female,Caroline,Acosta,5/27/1959,B+,145.4,5' 8"
5,male,John,Capps,12/18/1967,O+,186.6,5' 9"
6,female,Stephanie,Guidry,3/25/1981,O+,177.8,5' 6"
7,female,Janet,Kimmel,2/23/1977,A+,161.3,5' 7"
8,male,Jerrell,Wright,8/4/1929,B+,140.6,5' 9"
9,female,Cheryl,Johnson,12/8/1972,A+,128.7,5' 1"
10,female,Sandra,Gonzalez,6/1/1974,A+,171.4,5' 9"
11,male,Kevin,Noel,9/30/1939,O+,212.1,5' 6"
12,female,Krysta,Booth,7/9/1940,O+,173.1,5' 3"
13,male,Sam,Clark,7/5/1979,A+,162.4,5' 9"
14,male,James,Graves,8/15/1959,A+,235.0,5' 8"
15,male,Elton,Fink,6/30/1937,A+,198.4,5' 5"
16,male,Robert,Daniels,10/14/1969,Press any key to continue . . .
</code></pre>
