cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Set
Set
Dec 5, 2011 at 10:25pm UTC
mohammad jalali
(1)
how can i make a Two-dimensional set?
for example :
{{1,2,3} ,{1,2,4}}
Last edited on
Dec 5, 2011 at 10:26pm UTC
Dec 6, 2011 at 12:24am UTC
Catfish
(666)
You can have a set of sets...
1
2
3
#include <set>
std::set<std::set<
int
> > SetSet;
But if you're not using C++11 you'll have to use a temporary
set<int>
which you'll
insert()
into
SetSet
.
http://www.cplusplus.com/reference/stl/set/
http://www.cplusplus.com/reference/stl/set/insert/
If you're using C++11, you can work with initializer lists...
Topic archived. No new replies allowed.