Which one is better and preferable? I really find the reading API incomprehensible.
The member version is read in char* , the free version is read in std::string . Therefore, prefer the free version! Use it like this:
char*
std::string
std::istream & ins = /* ... */; std::string line; while (std::getline(ins, line)) { // process line }
Source: https://habr.com/ru/post/896094/More articles:How can I make sure my application is only available on Android Market phones? - androidForcing the inclusion of (in) declared variables in Fortran as a constant also in called routines / functions - fortranDelphi - moving overlapping TShapes - eventsJavascript Verb Detection - javascriptGet file size in windows - c ++Find if every even bit is set to 0 using bitwise operators - cHow to define my own js function in jsfiddle? - javascript.NET MVC Routing with Url Encoding Issues - url-encodingWhy does Scala consume 2–3 times more RAM than its competitors in the Benchmarks computer game? - performanceUsing Yacc and Lex in Xcode - objective-cAll Articles