I have a array which stores integer. Is there a way to delete all the elements of the array in the program itselft. I am not using new to create an array.
But I want all the contents of the array to be deleted .
How do I do that?
I have a array which stores integer. Is there a way to delete all the elements of the array in the program itselft. I am not using new to create an array.
But I want all the contents of the array to be deleted .
How do I do that?
myarray = {0};
Regards,
Mario Figueiredo
Using Borland C++ Builder 5
Read the Tao of Programming
This advise was brought to you by the Comitee for a Service Packless World
As fart as I know, there isn't a way to do that because the memory for this array is located at compile time if you do not use dynamic allocation with new.
But you can flag the elements indicating that there are not further used, for example you can set the array pointer to null.
Code:int main() { int somearray[somesize]; //Use array //flag array as unusable somearray[0] = NULL; return 0; }
Oh... he meant deleting all the dimensions.
Regards,
Mario Figueiredo
Using Borland C++ Builder 5
Read the Tao of Programming
This advise was brought to you by the Comitee for a Service Packless World