我在Visual Studio 2012的GUI环境中工作
void dealCard(PictureBox swag, Label swaggy)
{
swag.Image = imageListCards->Images[deck[cardCounter].index];
swaggy.Text = deck[cardCounter].name + " of " + deck[cardCounter].suit + ", " + deck[cardCounter].value;
if(cardCounter == 51)
cardCounter = 0;
else
cardCounter++;
}
void dealHand(PictureBox swag, PictureBox swag2, Label swaggy, Label swaggy2)
{
dealCard(pictureBoxCard4, labelCard4);
dealCard(pictureBoxCard5, labelCard5);
}
pictureBoxCard4, labelCard4等已经在我正在使用的形式。它没有编译部分dealCard(pictureBoxCard4, labelCard4)或下面的
要在函数中传递变量,必须使用指针。