Delete element from C++ array

前端 未结 11 882
逝去的感伤
逝去的感伤 2020-12-11 14:26

Please tell me how to delete an element from a C++ array.

My teacher is setting its value to 0, is that correct?

11条回答
  •  悲哀的现实
    2020-12-11 14:50

       :
        int main()
    {   
        int a[100],x,i;
        cout<<"enter the no. of elements(max 100): ";
        cin>>x;
        for(i=0;i>a[i];
            cout<>b;
        for(i=0;i=pos)
        {
            a[i]=a[i+1];
        }
        }
        cout<<"new array:"<

提交回复
热议问题