there is a structure
struct Record { int Score; UnicodeString Name; }; there is a vector
std::vector<Record> list; code to write structure to file
std::ofstream out("output.txt", std::ios::out | std::ios::binary); std::vector<Record>::size_type size = list.size(); out.write((char*)&list, sizeof(size)); out.write((char*)&list[0], list.size() * sizeof(Record)); out.close(); read code
std::ifstream is("output.txt", std::ios::in | std::ios::binary); std::vector<Record>::size_type size = 0; is.read((char*)&size, sizeof(size)); list.resize(size); is.read((char*)&list[0], list.size() * sizeof(Record)); is.close(); the problem is that the data is either not recorded (although there are changes in the file, but since it is binary it is difficult to determine what was recorded), or it is not readable (which is more likely because the new vector has size 0)
UnicodeString is a string type (all components usually in text properties accept / return a given type). I do the project in RAD Studio 10.2
UnicodeString? - Cerbo