c++ - Seg fault with getline function() Multi 5 compiler -
iam using multi 5 compiler , getting error tried access restricted memory getline function. please suggest issue.
anyfunction (std::string filepath) { std:string linear = ""; ifstream in; in.open(filepath); if(in.is_open()) { while (getline(in,linear)) // <- error here seg fault { do_someting(); } } in.close } int main() { std::string filepath = "\hello\asd.xml"; anotherfunction(filepath); anyfunction(filepath); //working of both function similar or both use getline }
Comments
Post a Comment