vector of map

R

raj s

How to create a vector consisting map as the element say like this
vector<map<int,char>>
 
A

anon

raj said:
How to create a vector consisting map as the element say like this
vector<map<int,char>>

#include <map>
#include <vector>

int main()
{
std::vector< std::map< int, char > > a;

std::map< int, char > b;
a.push_back( b );
}
 
A

aman.c++

How to create a vector consisting map as the element say like this
vector<map<int,char>>

Assuming you've provided the appropriate #include and namespace in
your program, your current compiler would be complaining about the >>
brackets.
You just need to provide a space between them like so:
vector<map<int,char> >

However if you pick a compiler that is C++0x / TR1 compliant yours
(vector<map<int,char>>) would be valid syntax.

regards,
Aman Angrish.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,920
Members
47,462
Latest member
ChanaLipsc

Latest Threads

Top