I\'ve got a database with approximately 200 000 items, which is sorted by username. Now when I add an item to end of array and call my quick sort function to sort that array it
the solution is to rewrite your code to use the stl, I don't understand why people write C code in C++.
You need a vector of User
std::vector users;
//then you can keep it ordered at each insertion
auto it = upper_bound(users.begin(), users.end(), user_to_insert,
[](auto& lhs, auto& rhs ) { /* implementation left to the reader */});
users.insert(it, user_to_insert);
You now have the same functionality in a much nicer and clean way