c++ - ifstream no conversion from char to char exists error -
int main() { char buffer[1024]; ifstream datafile ("./data.dat"); while(buffer) { localhouse->location = datafile.getline(buffer, 1024); } }
this throws error: no suitable converion function "std::basic_istream<char, std::char_traits<char>>" "char" exists.
it continues throw error if use pointer buffer instead. far can tell i'm using seen in example here.
there's example on stackoverflow here
that shows similar usage can't work, , it's causing me tear hair out on error seems can't convert char char. >.<
getline's return value istream object guess it's not want assign localhouse->location. getline reads line of file buffer variable have provided first parameter.
Comments
Post a Comment