Jonathan M Davis:

And it avoids having to do any conversions like your solution does.<

I understand now, thank you for explaining.
But in general I suggest to avoid using a solution like yours, unlesss this sorting is recognized by profiling as important for the performance of the program (and unless you add a well tested validation pass before your sort). Because sorting numbers as strings is a very good source of bugs. So better waste some time converting them, and doing things in a tidy way :-) Trust me... :-)

Bye,
bearophile

Reply via email to