Hi, does anyone know of a C++ sort algorithm or library that can take input of a bunch of rows and sort rows by an arbitrary defined order of such as
ie sort rows by first column in this order (boba bobc bobe bobx) etc?
Hi, does anyone know of a C++ sort algorithm or library that can take input of a bunch of rows and sort rows by an arbitrary defined order of such as
ie sort rows by first column in this order (boba bobc bobe bobx) etc?
Std::sort is designed for this - the 3rd parameter is the ordering/comparison function to use.
**sorry no example, I'm posting from my phone, google should have some ;)**
I see plenty of examples with simple stuff like arrays but I don't really see examples of how std:sort can work on arranging rows of a big input file let alone arranging them based on the value of a specific column in a predefined order ie (Z, X, A, B) .