所以我正在尝试将一张牌添加到玩家的手牌中......并且只有在我对顶部和最后一张牌使用双指针时,这张牌的值才会被传递回主函数。但是 last->pt 不能转换为 temp,我该如何解决这个问题?
typedef struct card_s
{
char suit[9];
int value;
struct card_s *pt;
} card;
void deal_card(card **top, card **last, card dealt)
{
card *temp;
temp = (card*)malloc(sizeof(card));
strcpy(temp->suit, dealt.suit);
temp->value = dealt.value;
if(*top == NULL)
*top = temp;
else
*last->pt = temp; //FIX ME - something is going wrong at this point
*last = temp;
last->pt = NULL; //FIX ME - same problem as above
}