Sort function C++ segmentation fault | Hacker News Reader