My modified code; still need help
Ok, I found the error, it's in my function, and I've modified it a little, and am still getting errors, but I know where the errors are: the errors are in the infile.read() statement. Something about not matching arguments. please help me. As usual, thanks for reading.
Code:
int read_regions(Region records[], char *filename)
{
ifstream infile;
infile.open (filename, ios::in | ios::binary);
if(!infile)
return fail;
else
{
infile.read(records, sizeof(records));
return 1;
}
}
:
And here are my errors messages:
assign1.cc: In function `int read_regions(Region*, char*)':
assign1.cc:40: no matching function for call to `std::basic_ifstream<char,
std::char_traits<char> >::read(Region*&, unsigned int)'
/opt/gcc-3.2/include/c++/3.2.1/bits/istream.tcc:778: candidates are:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>::read(_CharT*, int) [with _CharT = char, _Traits =
std::char_traits<char>]