S
Simon Morgan
I hope this isn't OT, I looked for a newsgroup dealing purely with
algorithms but none were to be found and seeing as I'm trying to implement
this in C I thought this would be the best place.
I have an array of structs containing data which I'd like to output
ordered based on the value of a single member. I was wondering if there is
a relatively simple way of doing this without actually modifying the
structure of the array?
I had a stab at doing this using last_printed and candidate variables
whereby I'd basically iterate through the array and check that
array.member > array[last_printer].member && array.member <
array[candidate].member
but this quickly got messy so I scrapped it.
Thanks.
algorithms but none were to be found and seeing as I'm trying to implement
this in C I thought this would be the best place.
I have an array of structs containing data which I'd like to output
ordered based on the value of a single member. I was wondering if there is
a relatively simple way of doing this without actually modifying the
structure of the array?
I had a stab at doing this using last_printed and candidate variables
whereby I'd basically iterate through the array and check that
array.member > array[last_printer].member && array.member <
array[candidate].member
but this quickly got messy so I scrapped it.
Thanks.