Quote Originally Posted by Adak View Post
Sounds like you don't have NUMBERS, you have digits in a string. So sort them as a string, (using strcmp() and including string.h naturally), and deal with any logic, in a "digit in a string", manner, rather than trying to deal with the digits as a number.
I have no idea where you got that from. He said that they were "of type int".

It sounds to me like you want to just sort your array of structs by their priority member. Then you can just walk through the array in order to process them. This can easily be achieved through the use of qsort and a custom comparison function. I suggest you have at using qsort yourself and perhaps post the definition of your struct and your attempt at using qsort.