Originally Posted by
caduardo21
...will that kind of linked list work?
Yes it shall.
Originally Posted by
caduardo21
...am I going to be able to do the sorting part with it?
Yes you shall, with something like this using qsort:
Code:
customCompare( const void *a, const void *b )
{
const struct person *a1 = ( const struct person * )a;
const struct person *b1 = ( const struct person * )b;
if( strcmp( a1->first_name, b1->first_name ) > 0 )
return 1;
else if( I'm too lazy to type this up )
return sajdflkasjf blah.. lol But you get the point!
}
qsort( createAPointerThatsAnArrayOfAllOfTheStructPersons( ),
getSizeOfLinkedList( ),
sizeof( struct person ),
customCompare( ) );