title: Create an array with external file in C++
body: <p>I have 4 days of training in C++, so bear with me.</p>
  
  <p>Two data files are required to evaluate a multiple-choice examination. The first file 
  (booklet.dat) contains the correct answers. The total number of questions is 50. A sample
  file is given below:</p>
  
  <pre><code>ACBAADDBCBDDAACDBACCABDCABCCBDDABCACABABABCBDBAABD
  </code></pre>
  
  <p>The second file (answer.dat) contains the students’ answers. Each line has one student
  record that contains the following information:</p>
  
  <p>The student’s answers (a total of 50 answers) in the same format as above (* indicates no answer)., followed by Student ID and Student Name. Example:</p>
  
  <pre><code>AACCBDBC*DBCBDAAABDBCBDBAA*BCBDD*BABDBCDAABDCBDBDA 6555 MAHMUT
  CBBDBC*BDBDBDBABABABBBBBABBABBBBD*BBBCBBDBABBBDC** 6448 SINAN
  ACB*ADDBCBDDAACDBACCABDCABCCBDDABCACABABABCBDBAABD 6559 CAGIL
  </code></pre>
  
  <p>I have a homework assignment to write a C++ program that counts the total number of correct answers by each student and outputs this information to another file called report.dat. In this file, the student’s IDs, names and scores must be given. Each correct answer is worth 1 point. For the sample files given above, the output should be as follows:</p>
  
  <pre><code>6555 MAHMUT 10
  6448 SINAN 12
  6550 CAGIL 49 
  </code></pre>
  
  <p>Here's what I have so far: </p>
  
  <pre><code>include &lt;iostream&gt;
  include &lt;fstream&gt;
  
  using namespace std;
  
  int main()
  {
      char booklet[50] answers[50]
      int counter
  
      // Link answers with booklet.dat
      booklet = ifstream
      input_file("booklet.dat");
      return 0;
  
      // Link answers with answers.dat
      answers = ifstream
      input_file("answer.dat");
      return 0;
  
  
      while (booklet==answers)
      {
          counter++
          cout &lt;&lt; "The student had"&gt;&gt;counter&gt;&gt; "answers right";
      }
  }
  </code></pre>
  
  <p>I'm not even sure I am in the correct direction.  I know I need to create an array from the file booklet.dat and another one from the file answer.dat. Then the comparison has to be made and the matches between the two have to be counted.</p>
  
  <p>I don't expect anyone to do the assignment for me, i just need a nudge in the right direction.</p>