Re: How can I use CArray efficiently?
- From: "David Ching" <dc@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 08 Apr 2007 20:01:29 GMT
"MrAsm" <mrasm@xxxxxxx> wrote in message
news:dr0i135rc2hpk0kvoma7lsd2vu4md6gp20@xxxxxxxxxx
maybe the std::vector is better designed than CArray.
You might consider using it.
std::vector is easy to use (consider that I'm not in the set of C++
template-gurus :) so, if I'm telling you that std::vector is easy, it
really is :)
On the contrary, I find STL collections to be very non-intuitive as compared
to the MFC ones.
with std::vector you have two concepts:
- capacity
- size
capacity >= size
The capacity is set in CArray::SetSize(). But CArray::GetSize(), and the
newly added method CArray::GetCount(), report the actual number of elements
added, not the value you set.
In addition, CArray::SetSize() has a second nGrowBy parameter which lets you
specify how many elements are added in case you go beyonod the initial
number reserved by the first parameter. I don't see anything like that in
STL.
-- David
.
- Follow-Ups:
- Re: How can I use CArray efficiently?
- From: Ajay Kalra
- Re: How can I use CArray efficiently?
- From: MrAsm
- Re: How can I use CArray efficiently?
- References:
- How can I use CArray efficiently?
- From: fiveight
- Re: How can I use CArray efficiently?
- From: MrAsm
- How can I use CArray efficiently?
- Prev by Date: Re: How many bytes per Italian character?
- Next by Date: Re: List control Korean Unicode Chars - No problem with managed code
- Previous by thread: Re: How can I use CArray efficiently?
- Next by thread: Re: How can I use CArray efficiently?
- Index(es):