For example, there is an array like this ==> array[10][10]
I want to pick a random element of this array like array[5][7]
and assign it to 0.
How can I do it?
For example, there is an array like this ==> array[10][10]
I want to pick a random element of this array like array[5][7]
and assign it to 0.
How can I do it?
Should be something like:
srand((unsigned) time()); // For different result every second
int x = rand() % 10;
int y = rand() % 10;
array[x][y] = 0;