How to delete an array statically?

Hey,
Just wondering whats the best way to delete an array when it has been statically created, not dynamically??
Thanx in advance
- Ryan
[154 byte] By [barbes] at [2007-11-17 22:40:14]
# 1 Re: How to delete an array statically?
If the array is created on the stack, it will be automatically deleted when it goes out of scope. You cannot use the "delete" operator on such arrays.
anujseth at 2007-11-8 1:11:18 >
# 2 Re: How to delete an array statically?
If you declare the array static inside a code block or if you declare it globally, then the compiler generated the code to call the destuctors of the array elements...you shouldnt try to do so
dumah at 2007-11-8 1:12:18 >
# 3 Re: How to delete an array statically?
One way is to write a wrapper for arrays and add a clear( ) or reset( ) function which deletes the contents of the array object without selteting the object itself.

soemthing like..

Array<int> MyArray(10,10);
....do something with MyArray

MyArray.Clear();
Gamut at 2007-11-8 1:13:20 >