+ 1

how to delete and insert an element in an array in c++

1st Feb 2022, 6:19 PM
1 Answer
+ 1
Array length is fixed, so you can't delete or insert items. If you really need to use the array, one way is make a new array with new length and copy the items from the old to the new. If you accept containers other than arrays, you can use vector or list. Tutorials of those are easy to find on the net.
2nd Feb 2022, 3:49 AM
你知道規則,我也是 - avatar