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..
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;
+ 1
Owh ok..tq..i will try it