cmp中有何问题,请大佬指教!
struct card{
char color;
int num;
}p[3][4];
int cmp(const void *a, const void *b)
{
if(((struct card *)a)->num != ((struct card *)b) -> num)
return ((struct card *)a)->num - ((struct card *)b) -> num;
else
return strcmp(((struct card *)a)->color,(*(struct card *)b).color);
}
[此贴子已经被作者于2016-12-12 17:10编辑过]