How do you delete an element from an array in C++?

170 Views Asked by At

I'm trying to make a program of choosing numbers and deleting arrays after. How do I delete an element of an array in a code?

#include <iostream>
#include <string>

using namespace std;

void main()
{
    int array[4];

    array[0] = 1;
    array[1] = 24;
    array[2] = 34;
    array[3] = 100;

    for (i = 0; i<4; i++)
    {
        cout<<"Enter the position you want to get rid of";
        cin>> array[i];
    }
}
0

There are 0 best solutions below