gnucompiler32

K

keithkerriekate

i have this
map<string,vector<int>>mv=x.begin();

i'd like to do this
map<string,vector<int>::iterator>itv=..something-i-don't-know-... to
access elements of vector using iterator
but this is impossible.

second,
i've tried this
map<string,vector<int>>mv=x.begin();
vector<int>::iterator it=mv->second->begin();
error is: no base pointer for second

thanks a lot, Keith
 
V

Victor Bazarov

i have this
map<string,vector<int>>mv=x.begin();

i'd like to do this
map<string,vector<int>::iterator>itv=..something-i-don't-know-... to
access elements of vector using iterator
but this is impossible.

second,
i've tried this
map<string,vector<int>>mv=x.begin();
vector<int>::iterator it=mv->second->begin();
error is: no base pointer for second

thanks a lot, Keith

Consider reading the FAQ before posting again, especially section 5.

V
 
Z

Zeppe

i have this
map<string,vector<int>>mv=x.begin();

Good morning to you!
i'd like to do this
map<string,vector<int>::iterator>itv=..something-i-don't-know-... to
access elements of vector using iterator
but this is impossible.

It's impossible to help you if you don't provide any info about the
actual problem. You can actually create such a map.
second,
i've tried this
map<string,vector<int>>mv=x.begin();
vector<int>::iterator it=mv->second->begin();
error is: no base pointer for second

the error message is you friend!
"error is: no base pointer for second"
1) look at the line in which there is the error;
2) look at the "second" token
3) why is it looking to a base pointer? because there is mv->second
4) mhy don't find it? because mv is not a pointer
5) infer the solution: mv.second
6) be happy

Regards,

Zeppe
 

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
473,794
Messages
2,569,641
Members
45,353
Latest member
RogerDoger

Latest Threads

Top