error C2784: 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_istream<_Elem,_Traits> &' from 'std::ifstream'
1> C:\Program Files\Microsoft Visual Studio 9.0\VC\include\string(527) : see declaration of 'std::getline'
void read()
{
Inventory items[100];
string line;
int i=0;
ifstream inventdata;
inventdata.open("Inventory.dat", ios::in);
if( !inventdata )
{
cout << "ERROR: Unable to open " << "Inventory.dat" << " ...exiting." << endl;
exit(1);
}
while(!inventdata.eof())
{
getline(inventdata,items[i].unitPrice);
getline(inventdata,items[i].itemNumber);
getline(inventdata,items[i].inStock);
getline(inventdata,items[i].itemName);
i++;
}
for(int j=0;j<100;j++)
{
cout<<items[j];
}
return ;
}
this is just the section where the code occurs after the while loop. i cant seem to find a fixx.