Set type in C++

This is a discussion on Set type in C++ within the C++ Programming forums, part of the General Programming Boards category; I'm playing aground with some algorithms that use set will give the program clearer. For example, init a setA, after ...

Set type in C++

I'm playing aground with some algorithms that use set will give the program clearer. For example, init a setA, after that, give some query like:
<put a into setA><delete a in setA>
<does a in setA> <does a not in setA>.....
Pascal has this data structure, but I don't know does it exist on C++, and how to use it.
please help me, please
thanks

I convert from Pascal to C/C++, so I have never use STD Library before. After I read about "set" on Wiki, they declare it begin with word: "template". And I google for what mean of "template", and OMG, they have many/many results about templates, each result say many/many things about it. It made me dizzy
So, who can tell me simple, or give me some hint(links,note...) about template and how to use them, please I'm feeling very sick, now :|

I convert from Pascal to C/C++, so I have never use STD Library before. After I read about "set" on Wiki, they declare it begin with word: "template". And I google for what mean of "template", and OMG, they have many/many results about templates, each result say many/many things about it. It made me dizzy
So, who can tell me simple, or give me some hint(links,note...) about template and how to use them, please I'm feeling very sick, now :|
thanks

For std::set take a look at: std::set reference
As for C++ and templates, you should really read through a book about C++ vice just jumping right into it. However we do have a good brief tutorial: Templates in C++

You don't need to worry about the "template" part. It's just how it's declared and not how it's used.
laserlight gave an example on how to create a set.
Aside from that, if you want to know more, I think you should get a good book such as Accelerated C++ to journey into C++.

OMG, after a long week playing aground with class,template,public,private,...(and many other keywords, maybe just have in OOP programming), at now, I have a new lesson, that I newly learnt: You don't need to know anything above(template,class...) to understand and use STD C++ library .
On long road to have above statement, I see another funny point: the most effective document are not recommend C++ book lists on many sites I found. The easiest way to learn is lecture of many universities I have googled. For example: MIT, and standford. They are short, easy to understand, and specially, always say to focus point. (at least, because they write for student )

At all, thank for all people here have given a vision how to learn C++ (although there a long way from know to understand )

after a long week playing aground with class,template,public,private,...(and many other keywords, maybe just have in OOP programming), at now, I have a new lesson, that I newly learnt: You don't need to know anything above(template,class...) to understand and use STD C++ library

Yes, at least for many of the common uses for the standard library.

Originally Posted by hqt

On long road to have above statement, I see another funny point: the most effective document are not recommend C++ book lists on many sites I found. The easiest way to learn is lecture of many universities I have googled. For example: MIT, and standford. They are short, easy to understand, and specially, always say to focus point. (at least, because they write for student )

Your mileage may vary for course material. Good academics are not necessarily good teachers, even if they genuinely are interested in teaching. Speaking of Stanford though, I recommend Accelerated C++, which has course material from a Stanford course involving C++ as a precursor.