1. Engineering
  2. Computer Science
  3. hi how would i make the copy card array print...

Question: hi how would i make the copy card array print...

Question details

Hi, how would I make the copy card array print an * if the random is equal to the card array?

the copycard array has the same elements as the cardarray but if the card array has a value that is equal to random than the copycard should print out an asterisk or * where the number is located at. instead, I keep getting long negative numbers where I am assuming where the * should be at.

#include

using namespace std;

int main()
{
int card[5][5];
int copycard[5][5];
srand (time(NULL));
int random = rand()% 10+1;
cout << random << endl;
  
for (int i= 0; i < 5; i++){
for(int m =0; m < 5; m++){
card[i][m];
copycard[i][m]=card[i][m];
cout << card[i][m]<< endl;
  
if(random = card[i][m]){
copycard[i][m]=='*';
cout< }
}
cout << endl;
}


return 0;
}

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution