Small Poker program rewrite I had already put up code for review a small poker program but I have rewrote it utilizing a more appropriate data structure.

How would I compare Poker hands accordingly?

Full source repo

enum poker_hands check_hand(vector *hand) /* check what kind of poker hand player has and return a score from 1 to 10 */
{
    sort_hand(hand);
    struct Card_s *temp[MAXHAND];
    for (int t = 0; t &lt; MAXHAND; ++t) {
        temp[t] = (struct Card_s*) vector_get(hand, t);
    }

    /* check for flushes */
    {
        bool flushsuit = true;
        for (int i = 1; i &lt; MAXHAND; ++i) {
            if (temp[0]-&gt;nSuit != temp[i]-&gt;nSuit) { /* check if card 1 is the same suit as the rest */
                flushsuit = false;
                break;
            }
        }
        if ( flushsuit ) {
            if ( temp[0]-&gt;nType == (temp[1]-&gt;nType-1) /* check if the cards increment one after the other */
                &amp;&amp; temp[1]-&gt;nType == (temp[2]-&gt;nType-1)
                &amp;&amp; temp[2]-&gt;nType == (temp[3]-&gt;nType-1)
                &amp;&amp; temp[3]-&gt;nType == (temp[4]-&gt;nType-1) )
            {
                if ( temp[4]-&gt;nType == ace )
                    return royal_flush; /* found royal flush */
                else
                    return straight_flush; /* found straight flush */
            }
            return normal_flush; /* it was a normal flush */
        }
    }

    int group[MAXHAND+1]    = { 0 } ;
    int rankcount[MAXTYPES] = { 0 } ;

    for(int i = 0; i &lt; MAXHAND; ++i) {
        int rank = temp[i]-&gt;nType;  // Get each card's type
        rankcount[rank]++;      // Increment each rank index
        group[rankcount[rank]]++;   // increment each rank's count index
    }

    if ( group[4] )
        return four_kind;

    if ( group[3] &amp;&amp; group[2] &gt; 1 ) // Found 3 of a kind and found another pair
        return fullhouse;

    if ( temp[0]-&gt;nType == (temp[1]-&gt;nType-1)
        &amp;&amp; temp[1]-&gt;nType == (temp[2]-&gt;nType-1)
        &amp;&amp; temp[2]-&gt;nType == (temp[3]-&gt;nType-1)
        &amp;&amp; temp[3]-&gt;nType == (temp[4]-&gt;nType-1) ) {
        return straight; /* found straight */
    }

    if ( group[3] )
        return three_kind;

    if ( group[2] &gt; 1 ) // If the 2nd index of the group[] array is more than 1, two pairs are found
        return two_pair;

    if ( group[2] )
        return pair;

    return highcard ; /* player only has a high card value */
}
Naming problem or design issue.  The first thing check_hand() does is to re-order the data.  I'd expect check_hand() to not alter hand, base on its name - it is a check.  Alternatively  just re-name it sort_check_hand().   Yet later code make a copy in temp[].  Better to copy into temp[] and then sort temp[], leaving hand[] alone.

//enum poker_hands check_hand(vector *hand) {
//  sort_hand(hand);
enum poker_hands sort_check_hand(vector *hand) {
  sort_hand(hand);

Code to detect a straight is redundant in flush strait and normal straight calculate.  Need only one.
Group detection.  Some poke like games find the best hand out of 5 cards (usual) or more (like 7 in 7 card stud) or betting order based on incomplete hands (1 to 9) cards.  A hand assessment that does not depend on 5 cards is more useful.
Rating.  Returning info as what kind of full house (Jacks over fives) is useful info for many games.  This code only returns fullhouse, three_kind etc, yet only needs a little more code to report the hand details.
Minor: Code for understanding.  By decrementing the smaller group count, group[2] only reports the numbers of pairs, not the sum of numbers of pairs, triples and 4-of-a kind.

// original
for(int i = 0; i &lt; MAXHAND; ++i) {
  int rank = temp[i]-&gt;nType;  // Get each card's type
  rankcount[rank]++;      // Increment each rank index
  group[rankcount[rank]]++;   // increment each rank's count index
}

if ( group[3] &amp;&amp; group[2] &gt; 1 ) // Found 3 of a kind and found another pair
  return fullhouse;

// suggested revision
for(int i = 0; i &lt; MAXHAND; ++i) {
  int rank = temp[i]-&gt;nType;
  group[rankcount[rank]]--;   // add
  rankcount[rank]++;
  group[rankcount[rank]]++;
}

if (group[3] &gt; 0 &amp;&amp; group[2] &gt; 0) {
  return fullhouse;