Qt Code:
  1. #include <QString>
  2. #include <QMap>
  3. #include <QRegExp>
  4. #include <QMapIterator>
  5.  
  6.  
  7. int main () {
  8.  
  9. QFile file("../MOVE QWidget/gamefiles/hiScores.txt");
  10. QMap<int,QString> fileMap;
  11.  
  12. if (file.open(QIODevice::ReadOnly)) {
  13.  
  14. QTextStream txt(&file);
  15. QRegExp rx("(^[0-9]+)");
  16.  
  17. while ( !txt.atEnd() ) {
  18. QString line =txt.readLine();
  19. rx.indexIn(line);
  20. int number = rx.cap(1).toInt();
  21. fileMap.insert(number,line);
  22. }
  23.  
  24. QMapIterator<int,QString> i(fileMap);
  25. i.toBack();
  26. while ( i.hasPrevious()) {
  27. i.previous();
  28. std::cout<<i.key()<<" ";
  29. }
  30.  
  31. }
  32. file.close();
  33. }
To copy to clipboard, switch view to plain text mode 


Ok, thanks a lot for your help!
As you see, i go through first advice of calhal.
code snippet of course in 'CODE' tags ;-)