title: ISO C++ forbids comparison between pointer and integer?
body: <p>Here is the code:</p>
  
  <pre><code>void option5 (StudentRecord student[], int n)
  
  {
     double gpaThreshold;
     char enteredMajor;
     int i;
  
     cout &lt;&lt; "Enter a GPA threshold: ";
     cin &gt;&gt; gpaThreshold;
     cin.ignore(80, '\n');
  
     cout &lt;&lt; "Enter a Major: ";
     cin &gt;&gt; enteredMajor;
     cin.ignore(80, '\n');
  
     enteredMajor = toupper(enteredMajor);
  
     for (i = 0; i &lt; n; i++)
     {
        if (student[i].gpa &gt;= gpaThreshold &amp;&amp; student[i].major == enteredMajor)
        {
           if (i % 10 == 0)
           {
              cin.ignore();
           }
           cout &lt;&lt; setw(3) &lt;&lt; right &lt;&lt; i+1 &lt;&lt; ". "  
           &lt;&lt; setw(20) &lt;&lt; left &lt;&lt; student[i].lastName 
           &lt;&lt; setw(20) &lt;&lt; left &lt;&lt; student[i].firstName 
           &lt;&lt; setw(8) &lt;&lt; left &lt;&lt; student[i].major 
           &lt;&lt; fixed &lt;&lt; setprecision(2) &lt;&lt; setw(8) &lt;&lt; left &lt;&lt; student[i].earnedHours 
           &lt;&lt; fixed &lt;&lt; setprecision(2) &lt;&lt; setw(6) &lt;&lt; left &lt;&lt; student[i].gpa &lt;&lt; endl;
        }
     }
  }
  </code></pre>
  
  <p>StudentRecord is a struct, and the only integer on that line is 'i', whereas the pointer (I would have to assume) is .major.</p>
  
  <p>I'm wanting to compare an entered major, with the "Major" values in the array.
  E.G. I type in Chem
  -turns to CHEM
  -fetches all students under that major (and threshold of GPA)
  -displays the above statement (all students of 'X' major)</p>
  
  <p>Any suggestions? Help? Comments? Positive/Negative Feedback?</p>
  
  <p>EDIT: Here is the struct:</p>
  
  <pre><code>struct StudentRecord
  {
     char     lastName [16];  // field definitions of the structure
     char     firstName[16];
     char     hometown [16];
     char     major[5];
     int      studentNumber;
     double   balance;
     int      earnedHours;
     double   gpa;
  };
  </code></pre>