私はプログラミングに不慣れで、コードに問題があります。それがどのように呼ばれるのかよくわからないので、グーグルで検索するのは難しいです。しかし、人間は私が何を意味するのかを理解すると思います。
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;
}
それを定義するか、文字列として操作しようとしましたが、機能しませんでした。誰でもこれについて私を助けることができますか?どうもありがとう!