Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

when i use this code while ((inFile >> strs[0] >> strs[1] >> nums[0] >> nums[1]

ID: 3835327 • Letter: W

Question

when i use this code

   while ((inFile >> strs[0] >> strs[1] >> nums[0] >> nums[1] >> nums[2] >> strs[2] >> strs[3] >> strs[4] >> nums[3] >> strs[5] >> strs[6]) != NULL)
   {
       persons[ind].setExtPerson(strs[0], strs[1], nums[0], nums[1], nums[2], strs[2], strs[3], strs[4], nums[3], strs[5], strs[6]);
       ind++;
   }

why am i getting the error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'std::basic_istream<char,std::char_traits<char>>' (or there is no acceptable conversion)   

Explanation / Answer

You are missing the header file <string>

std::string can be used to incude the <iostream>

operator overload that allows insertion of an std::string into an std::ostream is only included if you include the actual <string> header

You can add the whole code here as well if this did not fix the issue.