C++C++11C++14C++17Learn C++

Tutorial: Learn To Sort A Text File On Windows With C++

In C++ Builder sorting text string lines is very easy by setting Sorted property of a StringList to true. This example below sorts a given text file and saves as sorted in same name. void sort_textfile(UnicodeString filename) { auto str_list = new TStringList; str_list->LoadFromFile(filename); str_list->Sorted = true; str_list->SaveToFile(filename); str_list->Free(); } Sorting…
Read more