### Randomly Remove Points From Array

Hey,

So I am fairly new to programming with c++ and I was wondering if there was a way to set up a code with an array of variable dimensions that removed random points on that array i.e.

1111
1111
1111

then randomly remove a point:

1101
1111
1111

and then be able to repeat this process until all points are removed.
Any ideas?
My strategy is first count the remaining elements in the array, if there are/is remaining element(s), then generate a random index of the remainders and remove it.

 ``12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364`` ``````#include #include #include using namespace std; const int ROWS = 3; const int COLS = 4; bool removePoint(int arr[ROWS][COLS]); void print2dArray(int arr[ROWS][COLS]); int main() { srand(time(0)); int arr[ROWS][COLS]; for (int i=0; i
Okay! That makes sense, could you explain why you used void there? I am pretty sure i understand everything else. Thank you so much for your help.
Topic archived. No new replies allowed.