0

How to delete the user input in array struct in c++??

I want to delete the data that user input..but the struct that contain array cant be declare..i dont know how to declare it..

13th Jul 2019, 3:15 PM
Kuro Himitsu
Kuro Himitsu - avatar
2 Antworten
+ 4
Well as far as I know you cannot delete the user input in array but you can overwrite it. If you are talking about dynamic arrays then you need to delete/free the memory. If array is 1D delete []array; If array is 2D for (int i = 0; i < size; i++) { delete array[i]; } delete []array;
13th Jul 2019, 5:48 PM
blACk sh4d0w
blACk sh4d0w - avatar
+ 1
Owh ok..tq..i will try it
13th Jul 2019, 7:58 PM
Kuro Himitsu
Kuro Himitsu - avatar