i'm having trouble getting qsort() working...
Code:
char* allsongs[MAXSONGS];
int compare( const void *arg1, const void *arg2 )
{
/* Compare all of both strings: */
return _stricmp( * ( char** ) arg1, * ( char** ) arg2 );
}
qsort((void*)allsongs, 10, sizeof(char*), compare);
this is my modification of the example given in the MSDN. but it gets an access voilation. (btw allsongs is sucessfully filled with about 300 strings)
if i do the following:
Code:
sprintf("%s\n", allsongs[10]);
it outputs a song fine. have i overlooked somthing?