"Lijun Yan" <kela...@263.net> wrote in message news:udnEuUSx$GA....@cppssbbsa02.microsoft.com...
> Hi,
>
> after I add some Cstring into CStringArray, I want to delete the
> CStringArray, How to do it?
>
> use "delete myCstringarray[i] " will occur a compile error.
>
> Thanks in advance
>
> Lijun Yan
--
Adam
pan...@comwerx.net
http://members.xoom.com/Q3KillStats
http://cabadam.freewebsites.com
"Lijun Yan" <kela...@263.net> wrote in message
news:uk5CvxSx$GA....@cppssbbsa02.microsoft.com...
> for(UINT i=0; i < myCStringArray.GetSize(); i++)
> delete myCStringArray[i]; // complie error
> myCStringArray.RemoveAll();
>
> question as above.
> thx
>
>
> "Richard Kirchknopf" <spamof...@interlog.com> wrote in message
> news:OqLIDtSx$GA.247@cppssbbsa05...
question as above.
thx
"Richard Kirchknopf" <spamof...@interlog.com> wrote in message
news:OqLIDtSx$GA.247@cppssbbsa05...
> myCstringarray.RemoveAt(i); ?????
>
> "Lijun Yan" <kela...@263.net> wrote in message
news:udnEuUSx$GA....@cppssbbsa02.microsoft.com...
don't try to delete an item already deleted !
it's better !!!!
Marc
Stoled from MSDN (CStringArray):
"When a CString array is deleted, or when its elements are removed, string
memory is freed as appropriate."
So all you have to do is calling RemoveAt(...) or RemoveAll()...
--
Tenebrax
http://graff.ctw.net
for(UINT i=0; i < myCStringArray.GetSize(); i++)
myCStringArrayÀ.RemoveAt(i);
Hope it'll help, and take a look at MSDN !
--
Best regards,
-----------
Igor Sukhov (Brainbench/Tekmetrics ID:50759)
igor_...@mail.ru | s...@ipian.kazan.ru | ICQ:57404554 | http://siv.da.ru
Hi, Lijun Yan <kela...@263.net>! You wrote:
> for(UINT i=0; i < myCStringArray.GetSize(); i++)
> delete myCStringArray[i]; // complie error
> myCStringArray.RemoveAll();
>
> question as above.
> thx
>
>
> "Richard Kirchknopf" <spamof...@interlog.com> wrote in message
> news:OqLIDtSx$GA.247@cppssbbsa05...
> > myCstringarray.RemoveAt(i); ?????
> >
> > "Lijun Yan" <kela...@263.net> wrote in message
> news:udnEuUSx$GA....@cppssbbsa02.microsoft.com...
> > > Hi,
> > >
> > > after I add some Cstring into CStringArray, I want to delete the
> > > CStringArray, How to do it?
> > >
> > > use "delete myCstringarray[i] " will occur a compile error.
> > >
> > > Thanks in advance
> > >
> > > Lijun Yan
> >
> >
> >
>
>