kkirtac
August 8th, 2007, 04:52 PM
Hi, i want to dynamically resize my Array's size by deleting the entry of an arbitrary index. my Array contains String^ s.
cli::array<String^,1> files ;
When i use the Clear method of the Array and erase the entry of an index, it just sets Null for that entry but dont decrement the Array's size.
How can i dynamically decrement the Array's size when an entry is deleted ? Here is my piece of code :
for(j=0; j<files->Length; j++)
if( ! ( files->GetValue( j ) ) -> ToString() -> EndsWith( datatype) ) //dataType = "pgm"
files->Clear(files, j, 1);
Here, "files" holds the full pathnames of files in a directory.
Regards,
cli::array<String^,1> files ;
When i use the Clear method of the Array and erase the entry of an index, it just sets Null for that entry but dont decrement the Array's size.
How can i dynamically decrement the Array's size when an entry is deleted ? Here is my piece of code :
for(j=0; j<files->Length; j++)
if( ! ( files->GetValue( j ) ) -> ToString() -> EndsWith( datatype) ) //dataType = "pgm"
files->Clear(files, j, 1);
Here, "files" holds the full pathnames of files in a directory.
Regards,