Hello Experts...

I come from VB, And I remember using collection.

Well... I would need to use them in C++, (if possible).
I mean... Supouse that I defined a class like this

Class CTheClass

CTheClass ()
      Here goes the code for the constructor

int Member1;
int Member2;
char *Member3;

void MemberFunction(Param)



I will use an array of objects CTheClass, but while I write the program, I don't know how many object will I need... Then... I'd like to use something like those collections that I have used
in Visual Basic... Is there something like that in C++?.

I know that MFC has a class colection or something like that... But. What if I don't use MFC?.
I mean... programming in VC++ on Windows directly...

Thanks at all...
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MarscAuthor Commented:
Edited text of question.
What you are looking for is called STL - the Standard Templates Library. It includes the collections vector, deque, list, set, map, multiset and multimap. To use them, #include the standard headers <vector>, <deque>, <list>, <set> ot <map>.

To learn about the STL, see:

(No, you don't have to read *all* of these :-)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
There are also other collection classes such as CObList, CTypedPtrList, etc, but the STL approach I believe is supposed to be more type-safe...
> STL approach I believe is supposed to be more type-safe

.... but the big advantage of the Standard Template Library is that it is *Standard*, i.e. it is (or should be) available on all C++ compilers.

....and you have access to all the STL algorithms

....and you can easily write your own STL compliant containers/iterators and algorithms.

....and it introduces the a whole new 'generic' programming concept to C++ - the STL way of doing things is not really OO. works well with built in types and can be very efficient.

And it is as type safe as anything is in C++.
MarscAuthor Commented:
I didn't try all this stuff yet... But I've been reading, and it is sure what I was looking for.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.