c++ – wrong output searching in binary files using seekg() & seekp()

First, there is no way the code above will compile without error or warning. Specifically due to your use of: void setname(string tempname){ … tempname.copy(name , len); The .copy() member function is not a member of std::stringbut instead a member of std::basic_string_view (C++17). The compiler does not know what .copy() is in that circumstance. Instead, … Read more