Im having trouble trying to remove this whole array member But everytime I try to remove it and move the others I get the error. Lets just Say im trying to remove this line here. How would I do it? This is C++ btw.
Lassen California 5720 24 11624
[/*void display_removal(const Covid arr[], int& n, string name)
{
bool is_found = false;
for (int i = 0; i < n; i++)
{
if (is_found)
arr[i-1] = arr[i];
else if (arr[i].city == name)
is_found = true;
}
}
I would basically put in that city (Lassen) and then it would remove the whole line. But "arr[i-1] = arr[i]; is where the error appears