我是编程新手,我的代码有一些问题:我不太确定那个东西是如何被调用的,所以很难用谷歌搜索它;但我认为人类会理解我的意思:
while 循环每次增加 i++。在我想表达的评论行中
当 i = 1 时, player1.cards[j] = 随机;i = 2 , player2.cards[j] = 随机;
void cardScramble()
{
int random;
int i = 1;
while (i <= 4)
{
cout << "Card of Player " << i << " : ";
int j = 0;
while (j < 13)
{
random = rand() % 52;
if (cards[random] == NULL)
{
cards[random] = i;
cout << cardName(random) << " , ";
/* player(i).cards[j] = random; */
/* That's what I'm doubt with */
j++;
}
}
cout << endl;
i++;
}
return;
}
我试图将它定义或操作为字符串,但没有奏效。任何人都可以帮助我吗?非常感谢!